社区
C++ 语言
帖子详情
问题:error: ‘pthread_t’ does not name a type
blueboy82006
2011-08-06 08:38:09
我在linux上写了个多线程的代码,编译时报错:
error: ‘pthread_t’ does not name a type
我#include <pthread.h>
g++ 也-lpthread
虽说pthread_t是在 <bits/pthreadtypes.h>
里定义的,但pthread.h已经include进来了啊。
请问出现上述错误的原因是什么?
...全文
2999
5
打赏
收藏
问题:error: ‘pthread_t’ does not name a type
我在linux上写了个多线程的代码,编译时报错: error: ‘pthread_t’ does not name a type 我#include g++ 也-lpthread 虽说pthread_t是在 里定义的,但pthread.h已经include进来了啊。 请问出现上述错误的原因是什么?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
union_peace
2011-10-21
打赏
举报
回复
楼主能否告诉我问题的原因?因为我遇到类似的问题
blueboy82006
2011-08-06
打赏
举报
回复
解决了,原来错误不是那里……
qiuxin315
2011-08-06
打赏
举报
回复
贴代码。。
看看你的环境变量设置是否包含了pthread所在的目录,就是#include <pthread.h>你的程序是否能够搜索到。
blueboy82006
2011-08-06
打赏
举报
回复
[Quote=引用 1 楼 chinazhangjie 的回复:]
我不懂linux下多线程,从提示我猜可能有下面几种可能:
(1)pthread_t单词拼写错误
(2)你看一下pthread.h文件是否存在,包含路径是否有误
(3)如果存在,查看内容,是否存在pthread_t这个类型
(4)……
[/Quote]
你说的这几点我都确认过了,没有问题的
独酌逸醉
2011-08-06
打赏
举报
回复
我不懂linux下多线程,从提示我猜可能有下面几种可能:
(1)pthread_t单词拼写错误
(2)你看一下pthread.h文件是否存在,包含路径是否有误
(3)如果存在,查看内容,是否存在pthread_t这个类型
(4)……
Google C++ Style Guide(Google C++编程规范)高清PDF
link ▶Don't use an #include when a forward declaration would suffice. When you include a header file you introduce a dependency that will cause your code to be recompiled whenever the header file ...
ndk 编译webrtc出现 rw_lock_posix.h:35:
error
: 'p
thread
_rwlock_t' does not name a
type
我有两个相同的项目,一个就可以编译通过,另一个就不行,经过反复验证确定是application.mk的
问题
原来是android版本的
问题
,好像webrtc对android的版本要求过高,至少要求2.3.1,所以从原来的2.2换成2.3.1即可 ...
(前置定义)
error
: ‘__g
thread
_mutex_t‘ does not name a
type
121 | __g
thread
_mutex_t _M_mutex;
error
: '__g
thread
_mutex_t' does not name a
type
121 | __g
thread
_mutex_t _M_mutex; 解决方法: // main.h //mian.h #pragma once #include // 这里需要添加opencv头文件 #include #include #include "NvInfer.h...
Android2.2:'p
thread
_rwlock_t' does not name a
type
: android 2.3版本以下不支持读写锁的解决办法
好了,我前面的一篇blog已经讲过了这个
问题
。 http://blog.csdn.net/whitetao/article/details/7242712 在Android API 当时给的解决办法是改写application.mk文件,把版本改成9,APP_PLATFORM := android-9 //...
make xconfig 报‘ptrdiff_t’ does not name a
type
错误解决方法
这个
问题
可能常会遇到,我是在编译busybox时遇到,虽然menuconfig也可以,但是还是没xconfig好用。 解决办法是在报错位置的头文件加入#include <stddef.h>即可,我这里是qt3.3.8b版本,加在qvaluelist.h的最...
C++ 语言
65,183
社区成员
250,527
社区内容
发帖
与我相关
我的任务
C++ 语言
C++ 语言相关问题讨论,技术干货分享,前沿动态等
复制链接
扫一扫
分享
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
请不要发布与C++技术无关的贴子
请不要发布与技术无关的招聘、广告的帖子
请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下
试试用AI创作助手写篇文章吧
+ 用AI写文章