报错:undefined reference to `pthread_create'的处理
解决办法:
工程的property->setting->gcc linker->liberary下,添加pthread(注意不是-lpthread,也不是-pthread,如图1所示)
原因:
pthread不是默认的库,在linux中用文本进行编译,也要加参数-lpthread,这个道理是一样
本文介绍了解决在工程设置中遇到的pthread_create未定义引用问题的方法。通过在工程属性的链接器库设置中添加pthread,而非-lpthread,解决了由于pthread库未被正确链接而导致的编译错误。
报错:undefined reference to `pthread_create'的处理
解决办法:
工程的property->setting->gcc linker->liberary下,添加pthread(注意不是-lpthread,也不是-pthread,如图1所示)
原因:
pthread不是默认的库,在linux中用文本进行编译,也要加参数-lpthread,这个道理是一样

被折叠的 条评论
为什么被折叠?