2013-07-03 33 views
5

我正在編譯和使用Boost 1.54庫並已運行到一個deadend。對Boost線程的未定義引用

我編譯和安裝庫,如文檔中提到:

./bootstrap.sh 
./b2 install 

我甚至嘗試使用一個完整的重新安裝:

./bootstrap.sh 
./b2 threading=multi install 

我已經聯繫使用-lboost_thread-L*path提高* /箱.v2/libs

我仍然收到以下鏈接器錯誤:

undefined reference to boost::thread::start_thread_noexcept() 
undefined reference to boost::thread::join_noexcept() 

我在Eclipse的Ubuntu 12.04上使用gcc 4.6.3。

有誰知道我該如何解決這個問題?

+0

什麼'-lboost_system'? –

+0

它也被鏈接,因爲我也使用asio。 – Zippo

+0

你可以顯示你的實際鏈接器調用? –

回答

3

相當多的痛苦與Ubuntu軟件倉庫默認升壓後,我使用默認選項安裝升壓1.54.0(從官方網頁),和我下面的工作:

g++ test.cpp -o test -L/usr/local/lib/ -lboost_thread 

PS :在Ubuntu 12.04上,gcc 4.63

P.S2:包括在我test.cpp是:

#include "boost/thread/thread.hpp" 
#include "boost/bind.hpp" 
相關問題