2013-03-03 53 views
1

夥計!在Ubuntu中有沒有默認的庫路徑?

我使用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 to boost::system::generic_category()' boost_test.cpp:(.text+0xe4): undefined reference to boost::system::system_category()' /tmp/ccTKXzTR.o: In function boost::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 function boost::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 function boost::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 function boost::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 function boost::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

有人可以幫助,我圖如果我的圖書館已正確安裝並編譯出來?

+0

[此問題](http://stackoverflow.com/q/7765498/1011154)的副本,那裏接受的答案應該可以解決您的問題 – danjjl 2013-03-03 14:03:26

+0

謝謝,夥計們,這正是我正在搜索的內容。 – lucastamoios 2013-03-03 14:07:27

+1

這個問題似乎是脫離主題,因爲它屬於askubuntu.com – 2014-11-04 02:34:01

回答

4

我找到了/usr/include/boost是提升標題的路徑,/usr/lib包含了我想要的所有提升庫。