在編譯DSO代碼的時候會如下這樣的問題:

檢查DSO,在程序中沒有用到pthread,但是在編譯的時候卻出現此類問題。仔細想了想了一下,在程序中用到了C++11中的線程std::thread,個人猜測C++11在封裝線程std::thread時應當是使用到了pthread,pthread不是linux下的默認的庫,也就是在鏈接的時候,無法找到phread庫中線程函數的入口地址,於是鏈接會失敗。
解決方法:
最簡單的就是,打開CMakeLists.txt ,在所有用到boost_thread 的后面加上 -pthread,如下圖,保存並重新編譯,發現已經解決。

若未解決問題,可參考下列內容:
1.https://blog.csdn.net/hust_superman/article/details/37655891
2. https://www.cnblogs.com/yxysuanfa/p/7019725.html
3.https://blog.csdn.net/csdn_zyp2015/article/details/73087318
