Linux下eclipse编译C/C++程序遇到 undefined reference to `pthread_create'的异常解决办法
2015-03-31 14:37
856 查看
解决方法:右键点击的当前project—>properties—>C/C++ Build—>Settings—>Tool Settings选项卡—>GCC C Linker—>Command文本框g++后面添加 -lthread参数即可。
原因:-lpthread是老版本的gcc编译器用的,在新版本中应该用-pthread取代-lpthread
具体如下图所示:
原因:-lpthread是老版本的gcc编译器用的,在新版本中应该用-pthread取代-lpthread
具体如下图所示:
相关文章推荐
- Linux下编译C++程序遇到错误:undefined reference to '***'
- 在linux下编译线程程序undefined reference to `pthread_create'
- Linux下编译C++程序遇到错误:undefined reference to `*::*
- Linux c++ error: undefined reference to 'dlopen' 解决办法
- linux下编译C++文件(undefined reference to.....解决办法)
- linux下开发,解决cocos2d-x中编译出现的一个小问题, undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
- 编译linux 内核时:decompress.c:(.text+0x25c4): undefined reference to `error'的解决办法
- 编译C++程序遇到错误:undefined reference to `*::*
- eclipse编译openwrt应用程序报Type undefined reference to `pthread_create'错误解决方法
- linux 线程操作问题undefined reference to 'pthread_create'的解决办法(cmake)
- Ubuntu下使用Eclipse编译pthread程序错误undefined reference to `pthread_create'
- Linux 编译报错 -- undefined reference to 问题解决方法 (具体'pthread_create'和opencv看文章最后两条)
- linux下编译多线程程序, undefined reference to `pthread_create',undefined reference to `pthread_join'
- Eclipse c++ 中[Linker error] undefined reference to `WSAStartup@8'的解决办法
- linux下开发,解决cocos2d-x中编译出现的一个小问题, undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
- linux编译,解决类似于undefined reference to `*'
- 关于arm-linux-gcc交叉编译工具链,实现自己的crt0或者编译UBOOT出现undefined reference to `__aeabi_unwind_cpp_pr0'的解决方法
- C++:undefined reference to vtable 原因与解决办法 [转]
- gcc 编译程序 undefined reference解决办法
- 32位Linux编译redis失败解决方法:zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4`