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,如需转载请自行联系原作者


相关文章
|
TensorFlow 算法框架/工具
成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified ​​​​​​​
成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified ​​​​​​​
成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified ​​​​​​​
|
云计算
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
520 0
Google Earth Engine(GEE)——Error: Exported bands must have compatible data types; found inconsistent
|
机器学习/深度学习
FATAL ha.BootstrapStandby: Unable to fetch namespace information from active NN at ***
This problem (Unable to fetch namespace information from active NN) occurs, because the active namenode is not running.
2721 0
[Papers]NSE, $u$, Lorentz space [Bjorland-Vasseur, JMFM, 2011]
$$\bex \int_0^T\frac{\sen{\bbu}_{L^{q,\infty}}^p}{\ve+\ln \sex{e+\sen{\bbu}_{L^\infty}}}\rd s
648 0