Setting up Eclipse to use C++ on Windows

This tutorial shows you how to setup the Eclipse IDE on a Windows computer so you can develop C++ code with it. This will not take longer than 10 minutes, but depending on your Internet connection the downloads may take a while. I also assume that you don't have any parts previously installed, if you do please skips these particular steps.

1. Downloading Eclipse

Download Eclipse (Win32 version) from www.eclipse.org (approx. 120 MB) and install it to your local machine. This will both give you the Eclipse IDE and bundled a SDK version of Java. At this point you can already start using Eclipse with its built-in Java development features.


2. Download GNU C++ Compiler

Next we have to install a C++ compiler on your machine. We will use the MinGW package from Sourceforge. Go to http://sourceforge.net/projects/mingw/ and click on Download. You will see a page like this, look for the download of the 32-bit Windows version of MinGW.

Pasted Graphic 1


3. Install C++ Compiler

Run the MinGW installation program. When it asks you to configure the installation, check the box g++ compiler. I assume that you will install it to C:\MinGW

Pasted Graphic 2


4. Update Windows Path variable

Click on Start -> Control Panel. Under System, there is a tab called "Advanced" which has a button "Environment Variables". When you go to that dialogue, look for an entry "Path" in the Systems variables section. Edit this entry and add
; C:\MinGW\bin;

to the end. Notice the semicolon both before and after. If you installed MinGW somewhere else, use that path instead. Save and close that window.



5. Check Proper Configuration of MinGW and Path variables

We now check if the installation was successful. Go to Start -> Run..., type cmd into the dialog box and hit OK. On the following prompt, type gcc -v and press enter. If everything is correct, you should see something as:

Pasted Graphic 3

Notice that it says that c,c++ under languages. Close the window.


6. Download CDT Plugin

Go to http://www.eclipse.org/cdt/ and download the CDT plugin for your platform (Win32). When you unpack it, you will find a folder called eclipse in there, that has the folders plugins and features in it. Take these two folders and drag them into the folder where you have installed Eclipse into. You will see that there are also two folders named that way. When it asks you for confirmation, say yes.

Pasted Graphic 4


7.Wrap-Up

Open Eclipse and select Help -> About Eclipse. At the bottom of this page, there is a button called "Plug-in Details". Click on it. You should now see that there is the CDT plugin installed.

7