(已解决)遇到 undefined reference to pthread_getspecific问题

遇到 `undefined reference to pthread_getspecific'`

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

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

你可能感兴趣的:(问题解决,linux)