发文章
发文工具
撰写
网文摘手
文档
视频
思维导图
随笔
相册
原创同步助手
其他工具
图片转文字
文件清理
AI助手
留言交流
今天写了个Linux多线程 报了下面的错
由于pthread库不是标准linux库, gcc编译时候找不到
编译语句后加上-lpthread ,添加这个线程库
-lpthread
gcc thread.c -lpthread
在编译就没错啦
来自: 流楚丶格念 > 《待分类》
0条评论
发表
请遵守用户 评论公约
eclipse 函数编译时报错:undefined reference to `pthre...
由于pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,在编译中要加 -lpthread参数。...
undefined reference to 'pthread_create'问题解决
关于线程-lpthread问题
关于线程-lpthread问题关于线程-lpthread问题2011-03-16 19:45.pthread_create函数编译时报错:undefined reference to ''pthread_create''pthread_create()和pthread_atfork()函数使用...
Linux多线程编程(创建线程)
编译线程undefined reference to 'pthread_create'问题解决
问题原因: pthread 库不是 Linux 系统默认的库,连接时需要使用静态库 libpthread.a,所以在使用pthread_create()创建线程,以及调用 pthread_atfork()函数建立fork处理程序时,需要链接该库。
gcc -lpthread和gcc -pthread的区别
用gcc编译.cpp文件可能出现"undefined reference to `__gxx_personality
用gcc编译.cpp文件时出现undefined reference to `__gxx_personality_v0‘,可能某些gcc不支持,具体是什么问题,我也没有弄清楚(如果哪位大侠高清楚了,请告知).如我编译文件ds_attr.cpp.# gcc -ldb -o ds...
关于编译时出现undefined reference to `
关于编译时出现undefined reference to `关于编译时出现undefined reference to `_Unwind_Resume''错误的问。来源: ChinaUnix博客 日期:2007.12.12 11:47 (共有条评论) 我要评论 今天在...
交叉编译opencv
Platform/arm-linux to use this system, please send your config file to cmake@www.cmake.org so it can be added to cmake这个是因...
科技领域优质作者
微信扫码,在手机上查看选中内容