C++ Development Environment on Windows using Eclipse Ganymede and Nuwen MinGW
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++:
- Eclipse Ganymede for C++ instead of EasyEclipse for C++.
- Nuwen’s MinGW 3.9 Distro instead of official MinGW build.
Download/Install Eclipse Ganymede for C/C++ and Nuwen’s MinGW for Windows
- 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 Eclipse Ganymede IDE for C++ and extract it a directory.

- 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.

- 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.)
- 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):
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 ;)
Related Posts:
Readers who viewed this page, also viewed:
- EasyEclipse is the Best Packaged Distribution of Eclipse Platform
- N800 vs N810 or Who Should Consider Buying Nokia N810?
- Unit Testing C++ Programs using CppUnit in Eclipse IDE on Windows
- Six Popular IDEs For Developing Software in C/C++ on Windows Platform
- Setting Up C++ Development Environment on Windows with EasyEclipse and MinGW

Tk´s! This is what I was looking for. A modern version of GCC.
I have only one doubt. Can I use GDB with this version of MinGW?
QuoteComment by Andre — August 27, 2008 @ 10:56 pm
@Andre It would appear that you can’t use gdb with it as distibuted…. QUOTE:
“If you want a debugger, instead of building gdb, I suggest using MSVC’s excellent debugger. Look at libnuwen for an example of how to build programs with GNU Make and debug them with MSVC (hint: after running $(BATCH_FILE) , type devenv program.exe program.cc to open it up in the debugger). “
QuoteComment by Tiff — October 6, 2008 @ 11:20 pm
Can anyone get the example boost::regex code to compile using Nuwen’s build?
i.e:
#include
#include
#include
int main()
{
std::string line;
boost::regex pat( “^Subject: (Re: |Aw: )*(.*)” );
while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
}
When attempting to compile I get:
**** Build of configuration Debug for project boost test ****
**** Internal Builder is used for build ****
Quoteg++ -oboosttest.exe src\boosttest.o
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/basic_regex.hpp:262: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > >::do_assign(char const*, char const*, unsigned int)’
src\boosttest.o: In function `perl_matcher’:
c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/perl_matcher.hpp:347: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/regex_match.hpp:50: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator > >, boost::regex_traits<char, boost::cpp_regex_traits > >::match()’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/cpp_regex_traits.hpp:888: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform(char const*, char const*) const’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/cpp_regex_traits.hpp:892: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform_primary(char const*, char const*) const’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/perl_matcher_common.hpp:479: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator > > > const&)’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/cpp_regex_traits.hpp:436: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/cpp_regex_traits.hpp:438: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/pattern_except.hpp:75: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/perl_matcher_non_recursive.hpp:197: undefined reference to `boost::re_detail::get_mem_block()’
src\boosttest.o:c:/mingw/bin/../lib/gcc/i686-pc-mingw32/4.2.1-dw2/../../../../include/boost/regex/v4/perl_matcher_non_recursive.hpp:978: undefined reference to `boost::re_detail::put_mem_block(void*)’
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 484 ms.
Comment by Iain — November 27, 2008 @ 12:14 am