: 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

posted @ 2019-11-15 17:23  hbg-rohens  阅读(4894)  评论(0编辑  收藏  举报