Building Boost on Windows from https://github.com/boostorg/boost.git

Viewed 538

I have been trying to build boost Version 1.73 from its git repo https://github.com/boostorg/boost.git on Windows. And am able to build it, however when I try to use it in code, it is looking for boost 1.74 instead of 1.73.

Here are the steps I took to build it:

git clone --recursive https://github.com/boostorg/boost.git
cd boost
rm -rvf more
git checkout tags/boost-1.73.0
git submodule update --init --recursive

Once the cloning is done. I do the following:

bootstrap.bat
.\b2 --toolset=msvc-14.2 variant=release,debug threading=multi link=shared,static runtime-link=shared,static address-model=64,32 architecture=x86 --layout=versioned --stagedir=out\\release -j %NUMBER_OF_PROCESSORS% -q --hash

Boost gets built as expected, however when I use it in my code to be linked statically. The linker looks for boost version 1.74, which is the latest on master as of now. However if I download the sources from here and then build it, everthing works as expected.

Can anyone help me in pointing what I may be doing wrong?

TIA

1 Answers

You wrote:

Boost gets built as expected, however when I use it in my code to be linked statically. The linker looks for boost version 1.74,

You can verify that the string 1.74 doesn't occur in the Boost source code at all, using git grep 1\\.74 (two backslashes are needed with a POSIX shell, perhaps only one needed with a Windows command line?). I did this, and 1.74 really isn't there in the source code except in one file doc/test/test.svg as part of a number unrelated to versioning.*

In addition to the Boost which you are building, it seems that there is, or was, another version of Boost on your system, and MSVC is trying to use that. In your project that tries to use Boost, you need to look closely at the project properties. Look at the paths that MSVC searches for libraries and headers, there must be something there which isn't using the Boost that you build.

It's not clear why you don't also see this problem when you download the source from dl.bintray.com - that source is not identical to what you get from github, but the differences appear to be insignificant.


*Sadly, it seems that git grep is not as reliable as I would have thought. Using grep --recursive 1\\.74 * finds many other instances of 1.74. However, I believe they are all in numerical constants unrelated to versioning.

Related