Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable C++14 syntax checking in Eclipse

Tags:

eclipse

c++14

I'm using Eclipse Mars.2 Release (4.5.2) in Windows. C++11 works well, but for C++14, I can build and run a project using C++14 features without any error, but the IDE always highlights errors in the lines using C++14 features, it makes me difficult to detect real errors.

E.g. When using std::make_unique, it always highlight a bug symbol with notification "Symbol 'make_unique' could not be resolved".

How do I enable C++14 Syntax checking in Eclipse?

My current configuration:

Project property -> C/C++ build -> Setting -> Preprocessor -> Defined symbols:

  • __GXX_EXPERIMENTAL_CXX0X__
  • __cplusplus=201403L

Project property -> C/C++ build -> Setting -> Miscellaneous-> other flags:

  • -c -fmessage-length=0 -std=c++14
like image 971
Ikarus Avatar asked May 06 '16 02:05

Ikarus


People also ask

What C compiler does Eclipse use?

Eclipse CDT uses C/C++ Compiler. Hence before we can start using Eclipse CDT for C/C++ development, we need to have a proper GCC compiler on our system. We can either have 'MinGW' or 'Cygwin' compiler on our machine that will be used by eclipse.

Is Eclipse good for C?

However, it is mostly known for the remarkable support to JAVA – Eclipse has proven itself as a worthwhile IDE for C and C++ as well. It provides you with several useful features for C/C++ development such as auto-completion of code, code refactoring, visual debugging tools, remote system explorer, and many others.


1 Answers

You are going at this the wrong way. To change the compiler and indexer, go to Properties -> C/C++ Build -> Settings. Under GCC C++ Compiler select the Dialect menu. In the Language standard drop down, select C++1y. I don't think the support is full yet however.

like image 115
Derek Lesho Avatar answered Oct 12 '22 10:10

Derek Lesho