Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add C++ compiler to Eclipse C project

Tags:

c++

c

eclipse-cdt

Hi I am currently developing a C application in eclipse and now I need to compile a library which uses C++. Is there a way to add .cpp handling (MinGW C++ Compiler) to and existing C Project in Eclipse CDT?

like image 906
th3falc0n Avatar asked Jan 29 '13 15:01

th3falc0n


People also ask

Can we compile C in Eclipse?

To use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but having less features.

How can I use C language in Eclipse?

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 do I add C++ to 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. Answer "yes", and remember this decision.

How do I download C for Eclipse?

#2) Click Help =>Install New Software. In the “Available Software” dialog, enter “Kepler – http://download.eclipse.org/releases/kepler” (or Juno for Eclipse 4.2; or Helios for Eclipse 3.7) in the “Work With” field or pull down the dropdown menu and select the above link.


1 Answers

According to this post on the Eclipse forum, just add

<nature>org.eclipse.cdt.core.ccnature</nature>

to the the <natures></natures> tag of your .project file.

like image 178
dandan78 Avatar answered Oct 11 '22 04:10

dandan78