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