I am trying to build boost 1.63 with the lastest msvc 14.1 and VS2017 RC. So I did everything I do normally, I opened the Development Cmd and then I run the bootstrap.bat an
One more tip for build with Visual Studio 2017 which worked in my case. If you already built Boost with older version of Visual Studio, delete temporary batch files generated by Boost bootstrap script located in your user's TEMP folder e.g.:
C:\Users\MYUSER~1\AppData\Local\Temp\b2_msvc_14.1_vcvarsx86_amd64_.cmd
The solution comes from this thread: http://boost.2283326.n4.nabble.com/Building-boost-fails-with-VS2017-v15-5-2-td4700909.html
Boost 1.63 doesn't fully support VS2017, but you can trick it to find VC++2017 compiler:
bootstrap.bat
in boost directoryusing msvc : 14.0 : <path to x86 or x64 cl.exe>
. Should be something like "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.24911\bin\HostX64\x64\cl.exe"
b2 toolset=msvc-14.0
in that command prompt. For the x64 build, add address-model=64
to the b2 command line.UPDATE: Boost 1.64 should support VS2017
Run "x86 Native Tools Command Prompt for VS 2017" or "x64 Native Tools Command Prompt for VS 2017" from Start Menu, than inside command prompt run b2
:
32-bit: b2 toolset=msvc-14.1 --build-dir=.x86 --stagedir=stage_x86
64-bit: b2 toolset=msvc-14.1 address-model=64 --build-dir=.x64 --stagedir=stage_x64
Add link=shared
to build shared libraries
I've created a batch script which builds both 32 and 64 bits binaries in the following github repo: https://github.com/manuelgustavo/boost_build
The secret lies in using Visual Studio 2017's Developer Command Prompt. It sets all environment variables as needed.
Then from it, you can execute something like:
for 32 bit :
b2.exe --toolset=msvc-14.0 architecture=x86 address-model=32 --stagedir=".\stage32" threading=multi --build-type=complete stage
and for the 64 bit :
b2.exe --toolset=msvc-14.0 architecture=x86 address-model=64 --stagedir=".\stage64" threading=multi --build-type=complete stage
Or if you prefer, just go to https://github.com/manuelgustavo/boost_build and follow the steps from there.
Based on KindDragons and CPlusPlus OOA and D answers I compiled Boost 1.63. For 64bit. Run "x64 Native Tools Command Prompt for VS 2017" command prompt:
1) Run: bootstrap.bat
2) open project-config.jam
. Here is mine:
import option ;
using msvc : 14.0 : "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\cl.exe";
option.set keep-going : false ;
The part: 14.10.25017 keep changing with updates to your Windows SDK. So update it accordingly.
3) Run b2 toolset=msvc-14.0 address-model=64