Boost logo

Boost :

Subject: Re: [boost] Building Boost 1.69 with Visual Studio 1.69
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2019-02-24 13:46:03


On Sun, 24 Feb 2019 at 10:20, Trueman, Chris <ctrueman_at_[hidden]> wrote:
>
> Thank you for taking the time to reply. Following your steps, b2 is still trying to use the VS2017 compiler that I have installed. I can't seem to make it choose the VS2019 compiler.

I forgot completely about the project-config.jam modification.
Here is more complete procedure

1. START > Visual Studio 2019 > x64 Native Tools Command Prompt
2. cd D:\boost.win
3. .\bootstrap.bat
4. Edit generated project-config.jam and replace

using msvc ;
with
using msvc : 14.1 : "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.20.27323\\bin\\HostX64\\x64\\cl.exe"
;

5. Before you fire b2, you can remove -nologo from this line in
D:\boost.win\tools\build\src\tools\msvc.jam

https://github.com/boostorg/build/blob/20d72776c8b61613f0e3b32d01b17f9ee013db0d/src/tools/msvc.jam#L1488

6. Finally, run b2

.\b2 variant=debug address-model=64 --with-filesystem --with-test
--layout=system

...
compile-c-c++ bin.v2\libs\filesystem\build\msvc-14.1\debug\address-model-64\link-static\threading-multi\codecvt_error_category.obj
Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27323 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl "libs\filesystem\src\codecvt_error_category.cpp"
-Fo"bin.v2\libs\filesystem\build\msvc-14.1\debug\address-model-64\link-static\threading-multi\codecvt_error_category.obj"
   -TP /Z7 /Od /Ob0 /W3 /GR /MDd /Zc:forScope /Zc:wchar_t /favor:blend
/wd4675 /EHs -c
   -DBOOST_ALL_NO_LIB=1
   -DBOOST_FILESYSTEM_STATIC_LINK=1
   "-I."

and you should see the CL 19.20.27323 from VS2019 is actually used, that is:

D:\boost.win>cl /? | findstr optimized
Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27323 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk