Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++11 full support on Eclipse [closed]

Tags:

c++

c++11

eclipse

I am trying to find a way to get full C++11 support on Eclipse.

In Eclipse Juno I had a lot of new features with __GXX_EXPERIMENTAL_CXX0X__ but I didn't find support for std::threads, std::mutex, etc.

How can I have completion for all C++11 functions?

EDIT : Solution

Go to Project -> Properties -> C/C++ General -> Path and Symbols -> Tab [Symbols]. Add the symbol : __cplusplus with the value 201103L

like image 618
Jerome Avatar asked Feb 27 '14 16:02

Jerome


People also ask

Does Eclipse support C?

Eclipse is popular for Java project development. It also supports C/C++, PHP, Python, Perl, and other web project developments via extensible plug-ins. Eclipse is cross-platform and runs under Windows, Linux and Mac OS.

How to check Eclipse CDT version?

In the About Eclipse dialogue, click the Installation Details button. The Eclipse Installation Details dialogue appears. In the list of installed software, you should see "C/C++ Development Tools". The version displayed in the version column is the version of CDT.

How to Run C in Eclipse ide?

Launch Eclipse → Help → Install New Software → In "Work with" field, pull down the drop-down menu and select "Kepler - http://download.eclipse.org/releases/kepler" (or juno for Eclipse 4.2; or helios for Eclipse 3.7). In "Name" box, expand "Programming Language" node ⇒ Check "C/C++ Development Tools" ⇒ "Next" ⇒ ...

How to add c++ perspective in Eclipse?

In Eclipse, go to the "File" menu, then "New", then "C++ Project" if it's there. If not, choose "Project", then find "C/C++" in the list of wizards, click the "+" sign to expand it, and choose "C++ Project". A dialog box will ask whether to open the C/C++ perspective.


1 Answers

Eclipse works with C+11 support (Indexer and such) just fine: both Juno and Kepler. The thing is that you have to let Eclipse know that you are going to compile with C++11 support. This is done by providing additional flag -std=c++11 to CDT GCC Builtin Compiler Settings in C/C++ -> Build -> Settings -> Discovery [tab] so it will read something like:

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

And that is all you have to do with Kepler/Juno to get C++11 code highlighted correctly.

Note, this is workspace-wide setting. You can do the same on per project basis if you don't want to set it in workspace.

like image 96
lapk Avatar answered Oct 20 '22 10:10

lapk