Eclipse CDT显示语义错误,但编译确定 [英] Eclipse CDT shows semantic errors, but compilation is ok
问题描述
当我使用常用的预定义宏 __ BASE_FILE __
Eclipse说符号'__BASE_FILE__'不能解决了
,但是编译没问题。我必须在我的代码中经常使用它,Eclipse会用红线和错误图标填充我的屏幕:)
我该如何解决?
不知道这是否解决您的具体问题,但我也有语义错误。无论如何,我通过设置工作区设置中的单个选项来修复它:
构建配置对于索引器:使用活动构建配置
另一个选项是使用项目的索引器设置中指定的构建配置,这是不起作用的。我认为它可能在日食崩溃后被破坏。
I have installed Eclipse Indigo for C/C++ Linux developers on Ubuntu 10.04 x86.
When I use common predefined macro __BASE_FILE__
Eclipse says Symbol '__BASE_FILE__' could not be resolved
, but compilation is OK. I have to use it so often in my code and Eclipse fills my screen with red lines and bug icons :)
How can I fix this?
Not sure if this addresses your specific problem, but I also had semantic errors. They just came out of the blue after having a working project.
Anyway, I fixed it with a single option in workspace settings by setting: "Build configuration for indexer: Use active build configuration"
The other option was "Use the build configuration specified in the project's indexer settings" and this is the one that wasn't working. I think it may have been corrupted after an eclipse crash.
这篇关于Eclipse CDT显示语义错误,但编译确定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!