My friend alerted me a month ago about Nuwen’s build of MinGW toolchain that has version 4(currently 4.2.1) build of g++ compiler. Now that’s awesome. But that is not all: it also comes with C++ Boost 1.35 bundled as part of it, among many other useful C++ libraries.

Consider this post to be an update of my previous post “Setting Up C++ Development Environment on Windows with EasyEclipse and MinGW.” I will be using the following components in this post to setup the development environment for C++:

  1. Eclipse Ganymede for C++ instead of EasyEclipse for C++.
  2. Nuwen’s MinGW 3.9 Distro instead of official MinGW build.

Download/Install Eclipse Ganymede for C/C++ and Nuwen’s MinGW for Windows

  1. Download Nuwen’s MinGW distro and extract it in a directory. Try to extract it in a directory that doesn’t contain spaces or special characters in it: a good place to extract will be C:\MinGW.
    Download Nuwen's MinGW distribution.

    Extract Nuwen's MinGW distribution in a directory.

  2. Download Eclipse Ganymede IDE for C++ and extract it a directory.
    Download Eclipse Ganymede for C/C++ IDE.

    Extract Eclipse Ganymede for C/C++ in a directory.

  3. Run the Eclipse executable from the directory where you have extracted it(you can later place a shortcut to the Eclipse executable on the windows desktop/start menu/quick launch bar/etc. for quick access). When you try to create a new C++ project in Eclipse, MinGW will be automatically detected and be listed as one of the available toolchains. Automatic detection works the best if you extract in the directory as recommended in Step 1.

    Select installed Nuwen's MinGW toolchain when creating new C/C++ projects in Eclipse Ganymede for C/C++ IDE.

  4. You can check the version of the g++ compiler from the command prompt.
    C:\> cd C:\MinGW\bin
    C:\> g++ -v
    gcc version 4.2.1-dw2 (mingw32-2)

    (You don’t have the change the working directory to MinGW bin directory if its location is in the PATH variable.)

  5. Let’s write some C++ code making use of a Boost library and try compiling the code. Here is a screenshot of an example HelloWorld program(click to see the large version):

    HelloWorld C++ application in Eclipse IDE using Nuwen's MinGW distro.

It’s such a good thing for me to have discovered a MinGW build with g++ v4 and Boost bundled in it at around the same time that Eclipse Ganymede was released, I have to thank Stephen T Lavavej for bringing the C++ development experience on Windows a bit closer to that of GNU/Linux. Head to Nuwen’s MinGW page to learn what all is included in the distribution. You may also be interested in my previous post that I referred to at the beginning of this post.

Now for some more paying with the g++ 4.2.1 compiler on Windows ;)