【问题标题】:boost build site-config.jam on gentoo在 gentoo 上提升构建 site-config.jam
【发布时间】:2009-06-16 14:45:08
【问题描述】:

我在我的项目中使用 boost build,现在我想使用 boost date_time。我用谷歌搜索发现它应该(可能)以这种方式使用:

exe test : test.cpp /boost/date_time//date_time ;

但后来我收到了这条消息:

error: Unable to find file or target named
error:     '/boost/date_time//date_time'
error: referred from project at
error:     '.'

(当我手动使用-lboost_date_time 作为 gcc 标志时,它可以正常工作) 我认为必须将库 oly 添加到 site-config.jam,所以我尝试添加:

project /boost/date_time ;
lib date_time ;

但它没有效果。

我做错了什么?

谢谢

编辑: 我不是在寻找可行的解决方案。我需要一些对正确安装 boost.build 和 boost 库的人都有效的东西。

【问题讨论】:

    标签: boost-build


    【解决方案1】:

    我建议您查看当前版本的 Boost.Build 中的 contrib/boost.jam 模块。它允许您几乎自动地为每个库声明必要的目标。

    或者最初的尝试并不完全正确。要让“/site-config//boost_date_time”正常工作,您需要在 site-config.jam 中有这个:

    project site-config ;
    searched-lib boost_date_time ;
    

    如果库文件被命名为 libboost_date_time.so(如果 Boost 是使用 --layout=system 构建的就是这种情况),这将在 Linux 上工作。在 Windows 上,您实际上不需要任何这些,这要归功于自动链接。

    【讨论】:

      【解决方案2】:

      我在提升构建方面没有大量经验,但我相信您在站点配置中的规范已关闭(请参阅 herehere)。如果您尝试在您的站点配置中放置一个预建的 boost_date_time,那么它应该是:

      project site-config ;
      lib b_date_time : : <name>boost_date_time ;
      

      在你的目录中:

      exe test : test.cpp /site-config//b_date_time ;
      

      【讨论】:

      • 感谢您的回答。这可行,但这是指定预建提升库的正确方法吗?我正在尝试做的事情是,当有人全新(且正确)安装了 boost build 拉动我的项目时,它应该只是编译。我必须将此添加到问题中:-)
      • 我敢肯定,如果有人安装了 boost_date_time,它会起作用,但我不能说这是否是最佳实践。您可能对提升邮件列表有更多的吸引力:boost.org/community/groups.html#jamboost
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-09
      • 2014-02-28
      • 1970-01-01
      相关资源
      最近更新 更多