Skip to content
Alexander Saprykin edited this page May 25, 2024 · 28 revisions

Configurations

Version Compilers Status Tests
Windows 11 (ARM64) Visual Studio 2022 (ARM64) Compiled Passed
Windows 11 (ARM64) Clang 16.0.5 (ARM64) Compiled Passed
Windows 10 (x64) Visual Studio 2022 (x86, x64) Compiled Passed
Windows 10 (x64) Visual Studio 2019 (x86, x64) Compiled Passed
Windows 10 (x64) Visual Studio 2017 (x86, x64) Compiled Passed
Windows 10 (x64) Clang 17.0.1 (x64) Compiled Passed
Windows 10 (x64) Clang-cl 18.1.6 (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 Passed

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 the 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 is provided by the mingw-w64-make package. CMake is also available for the each of toolchains. You can read more about MSYS2 on its page.

MinGW-w64 (GCC) builds with version greater than 4.9.x 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), or disable optimisations completely (-O0 flag).

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

Clang

There are multiple general ways to use Clang on Windows, including:

  • 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. When using CMake to configure a project, pass ClangCL or clang-cl toolset name via the -T option, depending on Visual Studio version and installed LLVM.
  • Official Windows builds of LLVM provide precompiled binaries. These binaries can be used directly in Visual Studio development shell with nmake generator. Note that LLVM also comes with MSVC-compatible driver called clang-cl which can be used as a drop-in replacement for MSVC compiler. An alternative way is to use a custom LLVM installation starting from Visual Studio 2019, refer to instructions.
  • MSYS2 provides prebuilt packages of the latest Clang versions. Use pacman to install it.

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

Intel

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

Visual Studio

Easiest way to integrate the library into the Visual Studio is to use vcpkg packaging tool which provides lot of packages out of the box.

Using Visual Studio is straightforward: run CMake, choose required solution generator, run it and open generated solution in Visual Studio. Alternatively, a development shell can be used with nmake or msbuild tools.

Open Watcom

Open Watcom is an open source compiler with cross-compiling support. Works without issues.

Borland

Borland C++ is a compiler developed by Borland and CodeGear. Now it is developed by Embarcadero. Versions prior 5.7 (Borland C++ Builder 2006) are not recommended because they have brain-damaged socket subsystem implementation which is not fully compatible with WinSock2 behaviour.

Clone this wiki locally