FYI, Boost version is now version 1.72.0, not 1.70.0. Having a recent older version is not a problem, though.
You built Boost using toolset vc141. That is Visual Studio 2017's tool set. 2019 is vc142.
https://boostorg.github.io/build/manual/master/index.html#bbv2.reference.tools.compilers
(Scroll down for the msvc compiler versions)
This "mismatch" of tool set versions may, or may not, be part of your problem. But why take changes? I wouldn't.
I have both VS 2017 and 2019 installed. I build Boost for each VS version using a custom bootstrap and b2 command, so I get correct lib files for each. I build libs for both x86 and x64 compilation, as well as debug and release versions of the libraries.
If I had only one VS installed I'd still use a custom bootstrap and b2 command so I get it setup the way I want.
To build Boost I open a VS Developer Command Prompt for the VS version I am building Boost for.
Navigate to the Boost root dir. On my system that is:
D:\Programming\boost_1_72_0
I bootstrap Boost Build for whatever VS version I am building:
bootstrap vc141 or
bootstrap vc142
The invocation of b2 is the key to having multiple VS version libs built:
b2 --stagedir=lib\vc141 -a or
b2 --stagedir=lib\vc142 -a
That builds the lib and object (obj) files, putting the lib files in
Boost Root\lib\(VS version)\lib directory, creating them if needed. The obj files are in multiple directories under
Boost Root\bin.v2
Building the lib and obj files, debug and release, can take a loooooooooong time. Find something else to do other than staring at the monitor. There are more than a few warnings that pop up that DON'T appear to matter in building the libs, so not watching the process is less stress. :)
When the process is complete there is a note to tell you to add a couple of directories to your project properties (example):
The following directory should be added to compiler include paths:
D:\Programming\boost_1_72_0
The following directory should be added to linker library paths:
D:\Programming\boost_1_72_0\lib\vc142\lib |
Now, you are using a single VS, 2019, so I would
recommend using the following:
bootstrap vc142
followed by
b2 -a
That will put your lib files in
Boost Root\stage\lib
Whew! I know, long winded, but I hope this helps you with building and using Boost. :)
Yes, building Boost this way takes up a lot of HD space. Both the obj and lib directories/files on my system after building come in at around 10 GB of space.
If you ever want to rebuild Boost from scratch you can delete the obj and lib directories. Then bootstrap and b2 to recreate the files.
Oh, I forgot to mention.....
When adding the include and linker library paths in the project property settings set the Configuration to "All Platforms" and the Platform to "All Platforms" instead of the currently active configuration and platform happen to be.
Do this and no matter how you choose to build a project, debug or release - x86 or x64, VS can find the appropriate Boost files to build.
After setting the include and linker library path I recommend changing back to the current active configuration and platform option, though keeping the options at all configurations and platforms shouldn't cause problems.