linux 中 eclipse 開發 c/c++ 多線程程序,添加 libpthread.a 庫支持


 

導入頭文件

在 linux 中開發多線程程序,在使用到 pthread 系列函數的文件中,需要導入頭文件:

#include <pthread.h>

 

鏈接 libpthread.a 

在編譯的時候,需要鏈接 libpthread.a 庫

eclipse 中添加 libpthread.a 庫:
Project -> Properties -> C/C++ Build -> Settings -> GCC C Linker -> Libraries
1. 在 Libraries(-l) 中添加 pthread
2. 在 Libraries search path(-L) 中添加 crypto

 

 

 

 


免責聲明!

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



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