Undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'

不问归期 提交于 2019-12-10 15:12:55

问题


I just pulled a git repository in which me and my friends are developing an application. When I am running make I am facing this error:

undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:182: recipe for target 'bin/release/ns' failed make[1]: * [bin/release/ns] Error 1 Makefile:133: recipe for target 'release' failed make: * [release] Error 2

my friend pulled the same branch and he runs it without any problem.

Could you please give me some hints about the fix? Detailed answer would be highly appreciated.


回答1:


You should add "-lpthread" to your library. Of cause, you should also add the directory of libpthread to your library directories.



来源:https://stackoverflow.com/questions/34143265/undefined-reference-to-symbol-pthread-createglibc-2-2-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!