: error adding symbols: DSO missing from command line


寫了一個簡單的boost測試程序,編譯時出現如下錯誤:

 g++ -std=c++11 test_ssl.cpp  -o test -lboost_system -lboost_thread
/usr/bin/ld: /tmp/ccHdMo8P.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

 

其實,直接追加相應的庫文件即可。

 g++ -std=c++11 test_ssl.cpp  -o test -lboost_system -lpthread


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM