undefined reference to `pthread_create'


問題描述:

ubuntu 16.04  下  C語言開發環境,

已經添加了頭文件#include <pthread.h> 以及在Makefile中添加了 -lpthread,但是編譯時仍然報錯:

undefined reference to `pthread_create'

百度后得知,ubuntu下-lpthread必須跟在  gcc命令的最后才行。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM