本文介绍了禁用Eclipse的错误发现。 (Codan假阳性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在的经验是,Eclipse的错误发现是没有任何解决方案可怕的buggish尝试 __ GXX_EXPERIMENTAL_CXX0X __ -std = c ++ 0x -std = c ++ 11 )。我在这一点,我不想搜索一个解决方案不再。现在我只想看到真正的编译器错误。但是如何实现这一点呢?

解决方案

更新:答案已经过时了。我今天(2014年3月15日)仔细检查:在Eclipse Kepler(Build id 20130614-0229)中,足以




  • 工具 c> -std = c ++ 11 标志,


  • > 选项卡上选择 CDT GCC内置编译器设置并添加 -std = c ++ 11 code>标志到命令以获取编译器规格。在我的机器上,更改后看起来像这样:



    $ {COMMAND} -E -P -v -dD -std = c ++ 11$ {INPUTS}


  • 清除并重建您的项目


>

这在我的机器上可以正常工作。如果它不在你的机器上,那么你可能想要拍摄这个:虽然我既不确定这种方法的正确性,也不需要在我的机器上这样做。自2014年3月7日起,用户它帮助他们,而上述方法没有。









My experience until now is, that the error discovery of Eclipse is horribly buggish without any solutions (Tried __GXX_EXPERIMENTAL_CXX0X__, -std=c++0x, -std=c++11 in nearby every point of the settings). I am at the point that I dont want to search for a solution no more. Now I just want to see solely real compiler errors. But how to accomplish this?

解决方案

UPDATE: It's been a long time since I posted the original answer and it has become outdated. I double-checked today (Mar 15, 2014): in Eclipse Kepler (Build id 20130614-0229) it is sufficient to

  • add under Project > Properties > C/C++ Build > Settings then on the Tool Settings tab GCC C++ Compiler > Miscellaneous the -std=c++11 flag,

  • then under Window > Preferences > C/C++ > Build > Settings on the Discovery tab chose CDT GCC Built-in Compiler Settings and add the -std=c++11 flag to Command to get compiler specs. On my machine it looks like this after the change:

    ${COMMAND} -E -P -v -dD -std=c++11 "${INPUTS}"

  • clean and rebuild both your project and your index (Project > C/C++ Index > Rebuild) as Eclipse tends to cache error messages and show them even though they are gone after changing the settings.

This works on my machine for sure. If it doesn't on yours, then you might want to give a shot to this: C++11 full support on Eclipse although I am neither sure about the correctness of this approach nor was it necessary to do it on my machine. As of March 7, 2014 users claim that it helped them whereas the above approach didn't.


这篇关于禁用Eclipse的错误发现。 (Codan假阳性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 09:49
查看更多