Skip to content

Building under Windows

Jarle Aase edited this page Oct 30, 2017 · 9 revisions

At the moment, I am only testing with 64 bit builds for Windows. If you really need 32 bit Windows builds, please open an issue. The compilers supported under Windows is Visual Studio 2015, Update 3 and Visual Studio 2017.

Dependencies

For a full build with all the features enabled, you need to provide the following libraries, built for windows.

  • boost libraries
  • zlib
  • openssl

Microsoft has failed fundamentally in providing a sane environment for 3rd party libraries. As a result, there is no best practice or common way of dealing with this under Windows. While lots and lots of projects depends on boost, zlib and openssl, each developer or team has to download the sources and compile them themselves, and then do the patchwork to make other third party libraries find them. Some projects tries to lessen the burden on developers by embedding their dependencies as git sub-modules or blobs. However, as this may introduce different versions of, say zlib or openssl, in large projects where several libraries does this, I have chosen not to add to the confusion. You have to take responsibility for compiling the latest openssl and zlib (for security reasons), and make sure that restc-cpp finds, uses and links with these libraries. And if you use other libraries in your project that also depends on zlib or openssl, you must make sure that these also use the same zlib and openssl.

Building restc-cpp and its tests

I have provided example scripts to show how to build the project

  • build_vc2015.bat
  • build_vc2017.bat

Note that cmake and git commands must be available in the PATH, so they can be run from the command-line.

I have tested the .bat files by running them in the command environment for the 64 bit compilers (X64 Native Tools for ...) available from the Start Menu when Visual Studio is installed.

Please modify build_vc*.bat to specify where your local builds for zlib, openssl and boost are.

I have a section where I document how I build these libraries under Windows.

Testing under Windows

You can run the docker test containers locally or on another machine. If you run them remotely, you must set this environment variable to the IP number where they run:

set RESTC_CPP_TEST_DOCKER_ADDRESS=10.0.2.2

Include the directory with the boost,zlib and openssl dll's (the example is from my development VM):

PATH=%PATH%;C:\devel\bin

To run the tests:

cd build
ctest -C Release

Status October 30th, 2017

  • Visual Studio 2015: Unknown. Cmake is unable to find the 2015 C++ compiler on my Windows 10 Development machine (Both 2015 and 2017 is installed - cmake works with 2017). (Testing on a VM with just Visual Studo 2015 is pending)
  • Visual Studio 2017: Build is OK, all tests pass.