原文:Linux系統make時出現undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'錯誤

最近在進行specfem d程序的測試,在make時總是錯誤,提示 undefined reference to symbol pthread create GLIBC . . : 經國內國外多方查詢及嘗試,最終發現是makefile文件內容錯誤,現已解決,現將解決方法記錄如下。 本人系統為ubuntu . 在進行查詢后得知,主要是makefile中的 flags 缺少 pthread ,國外主要 ...

2020-09-11 19:56 0 3102 推薦指數:

查看詳情

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 symbol' pthread_create@@GLIBC_2.2.5'

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

Sat Oct 13 03:28:00 CST 2018 0 2393
linux undefined reference to symbol 'floor@@GLIBC_2.2.5'

這個是因為GNU make版本不一致導致,最后加上-lm g++或者gcc -o main main.c -lm 如果還存在問題 需要加上-Wl,--no-as-needed g++或者gcc -Wl,--no-as-needed -o main main.c -lm ...

Thu Mar 22 00:08:00 CST 2018 0 3478
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM