ubuntu 下沒有pthread庫以及報undefined reference to 'pthread_create'的解決方法

最近在Ubuntu下編譯一個程序,需要使用多線程庫pthread,但是編譯時總是提示「undefined reference to 'pthread_create'」的錯誤,如下圖所示: 要解決這個問題非常簡單 。先說怎麼解決。 如果你使用的是gcc編譯,或者將編譯命令都寫到makefile文件中了,例如我的makefile文件爲: [plain] view plain copy all:    
相關文章
相關標籤/搜索