如何让 Eclipse CDT 忽略错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11546776/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I make eclipse CDT ignore errors?
提问by Thuener
I'm having a lot of parser errors from eclipse but I don't have these errors when I compile the code. How can I ignore them?
我有很多来自 Eclipse 的解析器错误,但是当我编译代码时我没有这些错误。我怎么能忽略它们?
回答by Soverman
In the Indigo version of the CDT:
在 CDT 的 Indigo 版本中:
Project Settings -> C/C++ General -> Code Analysis
项目设置 -> C/C++ 通用 -> 代码分析
You can enable/disable specific errors and warnings, as well as customize inclusion and exclusion patterns for those warnings.
您可以启用/禁用特定的错误和警告,以及为这些警告自定义包含和排除模式。
If you get a large number of "Type 'TYPE' could not be resolved" errors, perhaps you need to make sure Eclipse can find all your code and libraries. You might want to check:
如果您收到大量“无法解析类型 'TYPE'”错误,您可能需要确保 Eclipse 可以找到您的所有代码和库。您可能需要检查:
C/C++ General -> Paths and Symbols
C/C++ 通用 -> 路径和符号
回答by user2770439
1 ]
1]
- Windows-->preferences-->type "anno" you will find annotation
- Navigate(scroll) to warning section , uncheck vertical ruler and rest if you wish
- Windows-->首选项-->输入“anno”你会发现注释
- 导航(滚动)到警告部分,取消选中垂直标尺并根据需要休息
other method
其他方法
- 2] go to project explorer right click any project you wish to disable/turn off warnings or such
- --->properties ---> c/c++ settings-->tool settings--->search your compiler c or C++ and ---> navigate to warning section----uncheck all (/any checked) ------> build project and Voila warnings gone :)
- 2] 转到项目资源管理器,右键单击您希望禁用/关闭警告等的任何项目
- ---> 属性 ---> c/c++ 设置--> 工具设置---> 搜索你的编译器 c 或 C++ 和 ---> 导航到警告部分----取消选中所有(/任何选中)- ----> 构建项目和 Voila 警告消失了 :)
回答by Andrew Tomazos
Under Settings you can selectively turn off and on which errors it reports, and how it displays them.
在设置下,您可以有选择地关闭和打开它报告的错误,以及它如何显示它们。