g++编译包含“pthread.h”头文件报错:对‘pthread_create’未定义的引用
1.在cpp程序代码中包含了“pthread.h”头文件,直接编译会报类似“对'pthread_create'未定义”的错误。
Eg:有文件thread.cpp,里面包含使用了“pthread.h”头文件和函数
编译:g++ -o thread.out thread.cpp
报错:在函数'main'中:
thread.cpp:(.text+0x5c): 对'pthread_create'未...
原创
2020-04-11 19:53:13 ·
1909 阅读 ·
0 评论