linux下用eclipse编译c++的pthread多线程配置

来源:互联网 发布:centos 6.5 bond配置 编辑:程序博客网 时间:2024/06/01 10:36

问题:eclipse使用pthread.h遇到“pthread_create”未定义的问题。
解决方法:
a.需要在编译时添加-lpthread参数
$ g++ XXXXX.cpp -lpthread -o XXXXX.o
b.在eclipse中配置
project>properties>c/c++Build>GCC C++Linker>Libraries
在Libraries(-l)中添加pthread
在Libraries search path(-L)中添加crypto

WALDM

原创粉丝点击