conflicting types for 'dev_t'的原因_DEAN's Space...

简介:

 在Linux下编译程序有时会遇到这种问题,这貌似是一个Linux历史遗留问题:

/usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’

/usr/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here

/usr/include/sys/types.h:67: error: conflicting types for ‘gid_t’

开始以为是GCC的版本问题,升级了版本也不好使,后来发现!进入编译出错的文件xxx.cpp:

把所有#include <sys/xxx.h>都提到最前面,把#include <linux/xxx.h>的包含放在其后,就可以编译通过了,之所以出现面的问题是存在循环引用所致。如:

#include <linux/apm_bios.h>

#include <sys/types.h>

变成

#include <sys/types.h>

#include <linux/apm_bios.h>



     本文转自 驿落黄昏 51CTO博客,原文链接:http://blog.51cto.com/yiluohuanghun/1175037,如需转载请自行联系原作者


相关文章
|
11月前
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
206 0
|
8月前
|
机器学习/深度学习 自然语言处理 数据可视化
M2E2: Cross-media Structured Common Space for Multimedia Event Extraction 论文解读
我们介绍了一个新的任务,多媒体事件抽取(M2E2),旨在从多媒体文档中抽取事件及其参数。我们开发了第一个基准测试
61 0
|
11月前
使用parted创建大分区时 mkpart Warning: The resulting partition is not properly aligned for best performance.
fdisk不能创建大于2T的分区,创建大分区得用parted,我在用parted创建分区时遇到下面的警告提示
169 0
|
云计算
Google Earth Engine(GEE)——Error: Exported bands must have compatible data types; found inconsistent
Google Earth Engine(GEE)——Error: Exported bands must have compatible data types; found inconsistent
438 0
Google Earth Engine(GEE)——Error: Exported bands must have compatible data types; found inconsistent
User Parameter UI2WD_TRKORR_CUST is not maintained
User Parameter UI2WD_TRKORR_CUST is not maintained
93 0
User Parameter UI2WD_TRKORR_CUST is not maintained