寫了一個簡單的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
