[Linux] Linux下undefined reference to ‘pthread_create’问题解决

 

问题的原因:pthread不是Linux下的默认的库,也就是在链接的时候,无法找到phread库中函数的入口地址,于是链接会失败。

 

解决:在gcc编译的时候,附加要加 -lpthread参数即可解决。

posted @ 2019-01-20 15:11  zhizhiyu  阅读(725)  评论(0编辑  收藏  举报