The best way to use C++11 on Windows

Programming modern C++ on Windows was lacking a lot of tools, like a state of the art compiler. Now that changed.

C++ is a very important language, however, it is messy to program and has been error-prone. Now with C++11 a lot of really useful features have been introduced. Also the STL has been extended and we are seeing a general cleanup of the language. This is all good stuff and in my opinion reason alone to switch to C++11 in any C++ project as soon as possible.

It is quite remarkable that Microsoft, which is the home company of Herb Sutter, who is chair of the ISO C++ standards committee, has not managed to release a state of the art compiler for C++11. Unless one wants to write C++/CLI or C++/CX, which are bound to .NET or WinRT, one is stuck with a compiler that cannot even handle dynamic array allocations.

This pretty much excludes Visual Studio / Microsoft Visual C++ from compiling most command line / cross-platform projects. Also the Microsoft variant of a makefile is really not the primary choice of any developer. So what are the alternatives?

  • Installing a VM with some Linux distribution
  • Mounting a folder on a remote machine with Putty
  • Trying to use clang for Visual Studio
  • Using something like Bloodshed C++
  • Installing a full CYGWIN software stack

Pick one and you'll see that you made the wrong choice. The issue here is that every listed option contains at least one major flaw. Of course using clang for Visual Studio would be a superb choice, unfortunately it is quite a mess to work with currently and the recommendation is to avoid it for the moment.

However, there is one option that is not listed and might be a clear winner for the moment: MinGW Distro from nuwen.net. That sounds quite strange in the beginning, but we'll see that this distribution contains everything one usually wants / needs:

  • A state of the art compiler (GCC 4.8.2, even with C++11 being defaulted)
  • A very good framework (Boost 1.55.0)
  • Cool libraries (libbzip2, libjpeg, libogg, libpng, SDL)
  • A set of indispensable tools (git, make, ...)
  • Really useful utilities (sed, lame, wget, ...)

All in all we get a state of the art C++11 set of tools that are perfect in combination with a great text editor like Sublime Text 2+. If one is serious about C++ one has certainly to consider this set.

Created .

References

Sharing is caring!