C++
Setting Up C++ Development Environment on Windows with EasyEclipse and MinGW
14Many people complain that configuring Eclipse+CDT/EasyEclipse IDE to work with MinGW C/C++ compiler tools on Windows doesn’t always go on expected lines. I hope the following howto would go some distance in addressing this issue. I use EasyEclipse IDE(what is EasyEclipse?) in this howto but the same procedure applies to Eclipse + CDT combination too.
To set up a C++ development environment using Eclipse+CDT/EasyEclipse and MinGW on a Windows operating system, the following steps need to be completed:
- Download and Install MinGW for Windows.
- Set MinGW in system PATH.
- Download and Install EasyEclipse for C++ and configure it to use MinGW tools.
-
Download and Install MinGW for Windows
- First download the Automated MinGW Installer from the sourceforge.net website.

- From whatever location you run the downloaded MinGW installer, it creates a few settings file there. So I recommend moving it to its own directory before running it. Move the installer file to a location like C:\mingw\ and run it from there.
You will see a welcome dialog; click Next to continue. Select “Download and Install” option from the next dialog box and click Next.

- Read the license and click Next if you agree to it. Select “Current” option from the next dialog box and click Next.

- Select at least “g++ compiler” and “MinGW make” from the shown components and click Next.

- Accept the default install location or enter a new location(should not contain any spaces in the path name) in “Destination Folder” text box and click Next.

- Accept the suggested Start Menu shortcut and click Install to begin the installation procedure. Depending on the number of selected components in Step 4 and the Internet speed, the download may take some time. When the installation is finished, click Close to dismiss the installer. MinGW is now installed on the system.
- First download the Automated MinGW Installer from the sourceforge.net website.
-
Set MinGW in system PATH
The second step is to add the MinGW bin directory path to the system/user PATH variable.
- Right-click on “My Computer,” go to “Advanced” tab and click the “Environment Variables…” button.

- Select the entry of PATH field, click the “Edit” button, hit the END key on the keyboard, add a semicolon and then type/paste the MinGW bin directory path. Click OK to dismiss all the dialog boxes.

- To verify that the PATH variable is set correctly, select to Start -> Run command and enter cmd in the text box. In the command window, type:
C:\> g++ -v
You should see the version information displayed.
If you get an error that g++ command is not found, then you have not set the PATH properly. Repeat the above instructions carefully or search through the Internet to learn how to change PATH variable in Windows.
- Right-click on “My Computer,” go to “Advanced” tab and click the “Environment Variables…” button.
-
Configure EasyEclipse for C++ to use MinGW tools
The third step is to download EasyEclipse for C++ package for the Windows OS and unpack it to a directory(say, C:\easyeclipse).
Go to the unpacked directory and click on the startup.jar file to run the EasyEclipse for C++ IDE. (You can right-click on this file and send a shortcut to the desktop or pin it to the start menu or add it to quick launch panel for easier access in the future.)
- To create a new C++ project, select File -> New -> Managed Make C++ project(File->New -> New Project to see all the options), enter a name and click Finish.
- Once the project is created, change the default ‘Build Command’ from ‘make -k’ to ‘mingw32-make -k’(to use MinGW’s make tool). This setting can be changed from Project -> Properties -> C/C++ Build -> Build Settings tab:

You can also access project settings by right-clicking on the project name and selecting ‘Properties’. - To add a new file to the project, select File -> New -> Source File, enter a name(say, hello.cpp) in the ‘Source File:’ text box and click Finish.
Type the following program in the editor:
[cpp]
#include
#includeint main()
{
std::string name = “world”;
std::cout << "Hello, " << name << ".";
std::cout << std::endl;
}
[/cpp]As soon as the file is saved, it is built automatically. The errors, if any, are highlighted by underlining them with red lines.
If you want to build the project manually, then uncheck the “Build Automatically” option from the Project menu.
- You are all set to add additional source (and header) files to the project now and expand the C++ application. Remember that Step 2 has to be repeated for every new C++ application created.

- To create a new C++ project, select File -> New -> Managed Make C++ project(File->New -> New Project to see all the options), enter a name and click Finish.
Good luck!
EasyEclipse is the Best Packaged Distribution of Eclipse Platform
6EasyEclipse is a distribution of Eclipse software development platform that simplifies the tasks of downloading, installing and maintenance while providing the same rich development environment of Eclipse. In the words of EasyEclipse creators:
EasyEclipse packages together Eclipse and selected open source plugins and is free and open-source, easy to download and install, and simple to maintain, without version and dependency issues.
EasyEclipse has become the perfect Eclipse distribution for me as I have always hated the fact that the newer versions of plugins played havoc with my old installation of Eclipse or vice versa; upgrading is so much simpler with EasyEclipse. All the work that I used to do of locating various plugins from all sorts of locations on the Internet, downloading and installing them, testing them, and once that is done, trying to always maintain the latest versions of Eclipse as well as all the installed plugins, is now done for me by the EasyEclipse creators. At least for the collection of plugins that EasyEclipse supports.
There are several different packages that can be downloaded from the EasyEclipse website depending on the kind of development environment one wants to set up. This further reduces the getting-started-with-eclipse curve. There are three major distribution categories:
-
Distributions for web and dynamic languages
Following packaged distributions are available for different type of web technologies:
- For PHP development: EasyEclipse for PHP
- For Python development: EasyEclipse for Python
- For Ruby On Rails development: EasyEclipse for Ruby on Rails
If you want one distribution to develop all kind of web applications, there is a ~180MB EasyEclipse for LAMP distribution that includes PHP, Python, Perl as well as Ruby on Rails environments. If you don’t already have a web server/database installed for testing web applications, XAMPP is the easiest way to do so.
-
Distributions for Java
The following varieties of Java distributions are available:
- Bare-bones: EasyEclipse Expert Java (Useful as a starting point to create personalised environment by installing user selected plugins)
- GUI with Swing/AWT: EasyEclipse Desktop Java
- Servlets, JSP, EJB etc: EasyEclipse Server Java
- J2ME: EasyEclipse Mobile Java
-
Distribution for C/C++
For C/C++ development, EasyEclipse neatly packages Eclipse with the CDT plugin as well as several other useful plugins; to access CVS/Subversion repositories, generating Doxygen documentation, etc. My experience of installing CDT in Eclipse always had mixed results whereas EasyEclipse for C++ worked every single time I installed it, on every single platform it supports. Eclipse for C++(just like Eclipse) needs some kind of a C/C++ development environment already installed on the system: Topic of next post.
There is also an EasyEclipse distribution for Eclipse plugin development: EasyEclipse Plugin Warrior
Once one of the above distributions is selected as the appropriate one based on one’s requirements, additional plugins can be installed easily by downloading them from EasyEclipse Plugins web page. All these plugins are well tested with all the EasyEclipse distributions and hence problems arise on very rare occasions. Such problems can be addressed at EasyEclipse Forum or the mailing list. There is an #easyeclipse channel on irc.freenode.net too but you need to hit the right time to find someone to answer your queries there.
If you want completely personalised Eclipse environment and you find all the plugins you need on EasyEclipse Plugins page, then start with EasyEclipse Expert Java and install just the plugins you need. You can also install all the plugins for Web, Java and C++ development this way to create a complete development environment(I start with Server Java or LAMP versions to do the same; saves me some time).
Last Words
EasyEclipse doesn’t (officially) support all the plugins that exist for Eclipse, far from it. But all these plugins do work with EasyEclipse just like they do with Eclipse, they are merely not tested by the EasyEclipse maintainers. In that sense, EasyEclipse gives me a better starting point than Eclipse does. I do hope that the number of Eclipse plugins supported by EasyEclipse increases with passing time.
Recent Comments