Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
540 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


The original post from 2012, now outdated:

These bogus errors come from Codan. I also issued a bug report (C++03!!!) but the same problem shows up in the latest stable Eclipse so I don't think much has happened :(

Workaround:

Click on the project properties, then C/C++ General > Code Analysis > Syntax and Semantic Errors and deselect whatever false errors you are getting.

I just want to see solely real compiler errors

Of course, you can disable there the static analysis completely, in that case you can accomplish exactly what you want.


UPDATE: 2 users have reported that what Jeevaka wrote helped them. I have tried what he wrote, it did not help me with Juno SR1 and CDT 8.1.1. Perhaps Codan developers have improved static analysis in Juno SR2 and CDT 8.1.2


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...