How to build Boost 1.61 with Visual Studio 2015

By , last updated September 29, 2016

Boost 1.61 was recently released (May 2016) and can be downloaded from http://www.boost.org/users/history/version_1_61_0.html.

This guide will build Boost for 32-bit and 64-bit architectures in a single click. Scripts for the impatient are available at GitHub (https://github.com/Studiofreya/boost-build-scripts).

Other Boost and Visual Studio versions:
Building Boost 1.62 with Visual Studio 2015
Building Boost 1.60 with Visual Studio 2015
Building Boost 1.58 with Visual Studio 2015

Building Boost 1.61

Here is a quick howto for Windows and Visual Studio 2015.

1) Download and extract either the .7z or .zip archive.

2) Create a file named build_boost_1_61_vs2015.bat in the same folder as the directory named boost_1_61_0 with contents like this:

call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86

set cores=%NUMBER_OF_PROCESSORS%
echo Building boost with %cores% cores

cd boost_1_61_0
call bootstrap.bat

rem Most libraries can be static libs
b2 -j%cores% toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64 
b2 -j%cores% toolset=msvc-14.0 address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/win32

pause

Run the build_boost_1_61_vs2015.bat file and wait until it finishes.

The rest of the guide will have pictures mention the previous version of Boost, but it should be Boost 1.61.

Finished building Boost 1.60

Using Boost 1.61 with Visual Studio 2015

There are several ways to include Boost library 1.61 in Visual Studio 2015.

Comments

  1. YL July 1, 2016 Leave a Reply

    failed to write output file ‘bin.v2\libs\context\build\msvc-14.0\debug\address-model-64\threading-multi\cxx11_hdr_mutex_check.obj.rsp’!

    thanks.

    • Kent Fagerjord July 2, 2016 Leave a Reply

      Hi,

      You’ve probably placed boost too deep into a nested folder structure, so that the Windows folder limit of 256 characters is exceeded.

      You’ll need to move the building of Boost to a folder without a long name, or you can try to use the --abbreviate-paths command switch to b2 to abbreviate the build paths.

      Edit the .bat file and put the switch after b2 so it reads b2 --abbreviate-paths .

      Or your disk could be full…

      Kent

  2. Cathy October 28, 2016 Leave a Reply

    got following error message:
    c:\test\boost_1_61_0\tools\build\src\engine\jam.h(71): fatal error C1083: Cannot open include file: ‘ctype.h’: No such file or directory
    compile.c

    I believe it detects NT is set and try to include “ctype.h”. But can not find. I tried to unset NT but does not work

Leave a Reply


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*