Makefile中要編譯多線程是報undefined reference to `pthread_create'相似錯誤

Makefile中要編譯包含線程庫的文件時,把-lpthread放在哪裏呢?線程 答:把-lpthread放在連接那句編譯命令的最後便可啦。如:  $(CC) -o test_threadpool main.o threadpool.o  -lpthread編譯 編譯階段是不用加這個參數的。thread
相關文章
相關標籤/搜索