[英]Let Eclipse know files included via -include gcc flag
I need to include a configuration header file (config.h), containing system-wise defines.我需要包含一个配置头文件 (config.h),其中包含系统定义。 Instead of including it in every source file, I used the -include gcc flag, like so:我没有将它包含在每个源文件中,而是使用了 -include gcc 标志,如下所示:
-include src/config.h
This works as expected, however Eclipse does not know that config.h is indeed included in every source file, so, whenever a block like this is present:这按预期工作,但是 Eclipse 不知道 config.h 确实包含在每个源文件中,因此,每当出现这样的块时:
#ifdef MACRO_DEFINED_IN_CONFIG_H
// Code block
#endif
everything is greyed-out.一切都变灰了。
Is there a workaround for this?有解决方法吗? Thank you.谢谢你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.