我使用ubuntu 12.04
並試圖編譯boost
測試程序。我安裝了升壓用
sudo apt-get install libboost-all-dev
的話,我不知道在哪裏可以找到我的圖書館。我試圖做編譯使用
g++ -lboost_system -lboost_thread boost_test.cpp
想也許有地方Ubuntu的自動安裝升壓一些默認的路徑,但它是錯的,我有以下幾點:
/tmp/ccTKXzTR.o: In function
__static_initialization_and_destruction_0(int, int)': boost_test.cpp:(.text+0xcc): undefined reference to
boost::system::generic_category()' boost_test.cpp:(.text+0xd8): undefined reference toboost::system::generic_category()' boost_test.cpp:(.text+0xe4): undefined reference to
boost::system::system_category()' /tmp/ccTKXzTR.o: In functionboost::system::error_code::error_code()': boost_test.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to
boost::system::system_category()' /tmp/ccTKXzTR.o: In functionboost::asio::error::get_system_category()': boost_test.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to
boost::system::system_category()' /tmp/ccTKXzTR.o: In functionboost::asio::detail::posix_tss_ptr_create(unsigned int&)': boost_test.cpp:(.text._ZN5boost4asio6detail20posix_tss_ptr_createERj[_ZN5boost4asio6detail20posix_tss_ptr_createERj]+0x19): undefined reference to
pthread_key_create' /tmp/ccTKXzTR.o: In functionboost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::task_io_service, boost::asio::detail::task_io_service::thread_info>::context>::~posix_tss_ptr()': boost_test.cpp:(.text._ZN5boost4asio6detail13posix_tss_ptrINS1_10call_stackINS1_15task_io_serviceENS4_11thread_infoEE7contextEED2Ev[_ZN5boost4asio6detail13posix_tss_ptrINS1_10call_stackINS1_15task_io_serviceENS4_11thread_infoEE7contextEED5Ev]+0x15): undefined reference to
pthread_key_delete' /tmp/ccTKXzTR.o: In functionboost::asio::detail::posix_tss_ptr<boost::asio::detail::call_stack<boost::asio::detail::strand_service::strand_impl, unsigned char>::context>::~posix_tss_ptr()': boost_test.cpp:(.text._ZN5boost4asio6detail13posix_tss_ptrINS1_10call_stackINS1_14strand_service11strand_implEhE7contextEED2Ev[_ZN5boost4asio6detail13posix_tss_ptrINS1_10call_stackINS1_14strand_service11strand_implEhE7contextEED5Ev]+0x15): undefined reference to
pthread_key_delete' collect2: error: ld returned 1 exit status
有人可以幫助,我圖如果我的圖書館已正確安裝並編譯出來?
[此問題](http://stackoverflow.com/q/7765498/1011154)的副本,那裏接受的答案應該可以解決您的問題 – danjjl 2013-03-03 14:03:26
謝謝,夥計們,這正是我正在搜索的內容。 – lucastamoios 2013-03-03 14:07:27
這個問題似乎是脫離主題,因爲它屬於askubuntu.com – 2014-11-04 02:34:01