原文:undefined reference to symbol' pthread_create@@GLIBC_2.2.5'

我在ubuntu . 上遷移工程,遇到了這個錯誤。 pthread庫不是Linux系統默認的庫,鏈接時需要添加 pthread參數。 這里注意是鏈接那一步添加 pthread,而不是編譯選項。 ...

2018-10-12 19:28 0 2393 推薦指數:

查看詳情

undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' 的修改方法

在編譯DSO代碼的時候會如下這樣的問題: 檢查DSO,在程序中沒有用到pthread,但是在編譯的時候卻出現此類問題。仔細想了想了一下,在程序中用到了C++11中的線程std::thread,個人猜測C++11在封裝線程std::thread時應當是使用到了pthreadpthread ...

Tue Mar 26 05:13:00 CST 2019 0 3644
undefined reference to `pthread_create'

問題描述: ubuntu 16.04 下 C語言開發環境, 已經添加了頭文件#include <pthread.h> 以及在Makefile中添加了 -lpthread,但是編譯時仍然報錯: undefined reference to `pthread_create ...

Fri Feb 22 18:50:00 CST 2019 0 911
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM