2009-06-16 31 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