2009-06-16 28 views
4

我在我的项目中使用boost构建,现在我想使用boost date_time。我一派,发现它应该(可能)这样使用:boost在gentoo上构建site-config.jam

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标志,那么它工作正常) 我认为,库奥菱已被添加到网站config.jam中,所以我尝试添加此:

project /boost/date_time ; 
lib date_time ; 

,但它没有任何效果。

我在做什么错了?

Thaks

编辑: 我不想找,只是有效的解决方案。我需要一些适用于boost.build和boost库的正确安装方法。

回答

2

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

或原始尝试不完全正确。有“/站点配置// boost_date_time”工作,你需要有这样的网站config.jam中:

project site-config ; 
searched-lib boost_date_time ; 

这将工作,在Linux上,如果库文件被命名为libboost_date_time.so(这是如果Boost是用--layout = system构建的话)。在Windows中,由于自动链接,您实际上不需要任何其他内容。

1

我没有大量的升压版本的经验,但我相信您在站点配置中的规格已关闭(请参阅herehere)。如果你试图把你的站点配置预建boost_date_time,那么就应该是:

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

而在你的目录:

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

感谢您的回答。这是有效的,但是这是指定预构建boost库的正确方法吗?我试图做的事情是,当新鲜(和正确)安装的boost build的人拉我的项目,它应该只是编译。我将不得不添加这个问题:-) – cube 2009-06-21 09:56:35