当前位置:   article > 正文

Include文件易犯编译错误_in file included from../../include

in file included from../../include

在cms.h文件中添加结构体变量后,编译总是报include文件编译错误,如下:

In file included from /.../public/include/cms_other.h:41:0,
                 from /.../public/include/linux/os_common.h:43,
                 from vlanctl_api.c:57:
/.../public/include/cms.h:508:4: error: unknown type name ‘UBOOL8’
/.../public/include/cms.h:509:4: error: unknown type name ‘UBOOL8’


问题真相:
cms.h中增加的变量有用到UBOOL8,其在os_common.h中的封装定义,
cms.h文件开头添加如下头文件引入:
#include "os_common.h"

os_common.h文件开头有添加引入头文件cms_other.h, 并在后面定义UBOOL8:
#include "cms_other.h"
....
....
typedef uint8_t    UBOOL8;

cms_other.h文件中又有引入头文件cms.h:
#include "cms.h"
问题关键就在这里,该处循环重复引用的cms.h中的UBOOL8还未定义,所以导致编译不过。




声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/201151?site
推荐阅读
相关标签
  

闽ICP备14008679号