LinuxC++多线程pthread_create错误
作者:三味书屋 来源:原创 2022/1/14 11:41:05
严重性 代码 说明 项目 文件 禁止显示状态
错误 127:对‘pthread_create’未定义的引用 TCPproject C:\usr\include\c++\8\thread 1

解决方法:

编译链接的同时指定参数-pthread

g++ -c main.cpp -pthread -std=c++11         // 编译
g++ main.o -o main.out -pthread -std=c++11  // 链接

VS中,在下述位置添加-pthread选项:


称      呼:
联系方式:
您的评论:
技术支持:l.w.dong@qq.com www.luweidong.cn
广州市   wx:lwdred
Copyright © 2014 三味书屋 All Rights Reserved
技术支持:l.w.dong@qq.com  sitemap xml  sitemap html

粤公网安备44010602011869号

粤ICP备13031080号-1