CDT 5.0.xCDT 5.0 runs with Eclipse 3.4 and is part of the Eclipse Ganymede simultaneous release. The main CDT feature can be installed from the Ganymede Discovery Site. This feature as well as all other CDT 5.0 features can also be installed from the CDT Ganymede Update Site with the following URL. Setting up a compilerUnfortunately Eclipse only provides the Integrated Development Environment (IDE) but it is missing the actual compiler. Windows compilerWindows doesn't come with a build-in compiler. You could try to install Visual Studio, but it is tricky to get that working with Eclipse. Therefore we will install MSYS. MSYS is part of the MinGW suite, which provides free development tools for Windows. You will have to follow these 4 steps:
First, you need to download MinGW. You can either click through the websites mentioned above or go directly to the MinGW download area. Look for the Package "Automated MinGW Installer". There, download the file ending in .exe. The file name should be something like "MinGW-5.1.4.exe". You can also download MinGW Version 5.1.4 from the link given here. Most of the options in the MinGW 5 installer are pretty straightforward. I will point out some of the more tricky options. The first one of such options is which "MinGW" package to
install. Any of those should work just fine, but I would recommend
MinGW will ask which components to install. Either select
When asked for the install folder, please do not change it. You will have a lot of trouble later on, especially if you chose a path that contains spaces. GDB
If you want to use the debugger, you may have to install it
separately. Download it from http://sourceforge.net/projects/mingw/files/GNU%20Source-Level%20Debugger/Current%20Release_%20gdb-5.2.1/gdb-5.2.1-1.exe/download , look for a package
starting with gdb and ending with .exe. Checkpoint: gdb --version should print the gdb version. MSYSUnfortunately MinGW is not enough. We also need the MSYS tools
from the same download page : http://sourceforge.net/projects/mingw/files/ . Go there again, to the "Current" section
and look for "MSYS Base System". The one I used was : http://sourceforge.net/projects/mingw/files/MSYS%20Base%20System/Current%20Release_%20MSYS-1.0.11/MSYS-1.0.11.exe/download
![]() If you accept all the default options, after a while there should be a black and white window, similar to this: To continue the install type in y and then Enter. The next question reads like this: Which you can also answer with y Enter. The next question is a little bit more tricky: What they want to know is where you installed MinGW to and that you replace all backward slashes (\) by forward slashes (/). If you followed the instructions, the answer here will be: C:/MinGW Caveat: If you have not used the default paths, but instead have
installed MinGW in a different location, such as
The very last question just asks you to press a key: Where you can press any key you like to continue. Setup will come back and ask you if you want to read a welcome note and the README file. You probably don't want either one, but it does not hurt to look. Anyways, once you hit "Finish" you are done with the setup. Now you have to set up your Path environment variable. Setting up EclipseInstalling the CDTIn the "Help" menu select "Install New Software..." This will show you the list of available software update sites. If
you are luck you already have the CDT update site configured. Search for
an entry which contains the String "cdt", for example
When you have found the CDT site, it will give you two entries: CDT Main Features and CDT Optional Features. Expand both, and find the latest version of the CDT. Make sure you select at least the following:
The select "Next..." You will have to confirm the selection with "Next". And accept the license agreement with "Finish". Downloading and installing will take a while. Once its done it will ask you to restart Eclipse. This is a good idea, so select "Yes". Once Eclipse has restarted you now need to configure it for your computer. Fortunately, this is very easy. If your path is set correctly, there should be absolutely nothing you need to configure. This is especially true if you followed these instructions for Windows systems. On some Unix systems you might have to change your "make" program to "gmake". You will find the setting in Window / Preferences. Then expand "C / C++", then "Make" and select "New Make Projects". At build command, de-select "use default" and at "Build command" enter "gmake". Once you are in Eclipse, you are given an empty workspace. You now have to start a new project. To do so, select "File" / "New" / "Project...". Expand the section "C++" and select "C++ Project", then click "Next >". On the next screen, you have to give your project a name. In this case, it will be "HelloWorld", however, you may use any name you like. Also, you have to select a toolchain, if you followed my instructions you are using the GNU Toolchain, and it should automatically give you the right option. Click "Next". The next screen contains some Basic settings. Fill in what you like: In the last setting you can chose output formats, it is always good to have a release and a debug configuration. Click "Finish". Eclipse will now generate a few things, and then ask you if you want to switch to the C/C++ Perspective. This is a good idea, so say yes. Great. You have a project now, and it does contain some sample code! You will immediately get an editor window for your project. Eclipse will also auto-build your project every time you save. Now here comes the tricky part: On the left pane, select "C/C++ Projects", expand "Binaries" and you should see and executable (HelloWorld.exe). Now right-click that executable, and select "Run" / "Run Local C/C++ Application". If everything goes well your output will be in the bottom right window in the "Console" tab and it should say "Hello, World". Congratulations! You have successfully installed a compiler, a build system and an IDE. You have successfully created, edited, compiled and run a project. You should now be able to start your own projects! |
Editors/IDEs/Developmental Tools > Eclipse >