Skip to content
Alexander Saprykin edited this page May 30, 2016 · 28 revisions

Windows

Configurations

Version Compilers Status Tests
Windows 7 SP1 (x64) MinGW GCC 5.3.0 (x86, x64) Compiled Passed
Windows 7 SP1 (x64) Clang 3.8.0 (x64) Compiled Passed
Windows 7 SP1 (x64) Intel XE 2013 (x86, x64) Compiled Passed
Windows 7 SP1 (x64) Visual Studio 2012 (x86, x64) Compiled Passed
Windows 7 SP1 (x64) Visual Studio 2015 (x86, x64) Compiled Passed
Windows XP SP3 (x86) Visual Studio 2015 (x86) Compiled Passed
Windows XP SP3 (x86) Borland 5.82 (x86) Compiled Passed
Windows XP SP3 (x86) Open Watcom 1.9 (x86) Compiled Not run

Regular test builds are run on AppVeyor.

If you need IPv6 support on Windows XP you must enable it manually using the following command: netsh int ipv6 install. Without enabled IPv6 all calls related to IPv6 addresses and sockets will fail.

MinGW

MinGW-W64 is an advance of the original MinGW project to provide GCC support on Windows including 64-bit API. It has easy-to-use online installer where you can select all required packages. You should have no problems with compilation using MinGW-W64.

MSYS2 provides POSIX environment to build native Windows binaries. After installing core MSYS2 distribution you need to install required MinGW-W64 toolchains and utilities: look for mingw-w64-i686-* and mingw-w64-x86_64-* package prefixes. You need at least GCC and make utility which provides mingw32-make binary. CMake and Boost are also available for the each of toolchains. You may need to explicitly pass to CMake name of the make utility and project generator: -DCMAKE_MAKE_PROGRAM=mingw32-make -G"Unix Makefiles". You can read more about MSYS2 on its page.

MinGW-W64 (GCC) builds from the MSYS2 distribution may have some problems with optimizations which can lead compiled programs to unpredictable crashes. In that case you can try to compile code with -fno-aggressive-loop-optimizations flag (introduced in GCC 4.8.0).

Note. You must use MinGW-W64 shell to build native binaries, do not use MSYS2 shell directly.

Clang

Clang on Windows is still some sort of an exotic, but the situation is better with the every release. There are three general ways to use Clang on Windows:

  • Starting from Visual Studio 2015 Update 1 Microsoft offers out-of-the box Clang experience. Read about Clang support in Visual Studio. You can also read more about supported features. Actually it is a Clang parser with Visual Studio's code generator and optimizer. This way has problems with Boost compiling (it seems that Boost treats such a compiler as pure MSVC).
  • Official Windows builds of Clang add custom toolsets into Visual Studio (i.e. LLVM-vs2014). In the newer versions of CMake you can pass toolset name using -T option. This way you can use original Clang compiler for Visual Studio projects. Latest CMake refuses to work with these toolsets.
  • MSYS2 provides prebuilt packages of the latest Clang versions. Use pacman to install it. It is a native Clang compiler and the most easiest and good working path. Though it is working only for x64 builds.

If you are going to build Clang by yourself this manual is quite a good starting point.

Intel

Using Intel C/C++ compiler is straightforward: setup development environment using supplied scripts with appropriate Visual Studio version and target architecture (Intel doesn't supply linker). Run CMake from the prepared environment and point out path to Intel C/C++ compiler for selected target architecture.

Visual Studio

Using Visual Studio is really easy: run CMake, choose required solution generator, run it and open generated solution in Visual Studio.

Open Watcom

Open Watcom is an open source compiler with cross-compiling support. It is not officially supported by Boost so I'm not able to run tests though the library itself compiles fine.

Borland

Borland C++ is a compiler developed by Borland and CodeGear. Now it is developed by Embarcadero. I do not recommend you to use versions prior 5.7 (Borland C++ Builder 2006) because they have brain-damaged socket subsystem implementation which is not fully compatible with WinSock2 behavior. Those old versions are not fully supported by Boost.

Clone this wiki locally