3

I Installed boost 1_60 using the visual studio 2015 command prompt:

bootstrap.bat
b2 --toolset=msvc-14.0 architecture=x86 address-model=64 

However when I include the headers and link to the libraries in a new visual studio 2015 (update 1) project (target machine =x64) I obtain the following error:

error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match    value '1900'

I manually renamed one of the lib files to vc120 and inlcuded them in a new visual studio 2013 project. No linker errors occur. So apparently boost compiled boost using the visual studio 2013 compiler instead of the visual studio 2015 compiler even when the toolset is set to msvc-14.0

cevertje400
  • 65
  • 1
  • 5
  • You could try rebuilding boost without specifying `--toolset=msvc-14.0` so that the build system could figure out the right version itself. – Lingxi Apr 06 '16 at 16:20
  • 1
    @Lingxi specifying `toolset=msvc-14.0` is correct for MSVC2015, but boost 1.60 seems to cause lots of people build issues, see my answer [here](http://stackoverflow.com/questions/35217511/boost-1-60-0-zip-installation-in-windows/35223257#35223257) – kenba Apr 06 '16 at 17:10
  • Let me guess... You have multiple boost installations and incorrect boost library linked with your project. – Sergei Nikulov Apr 07 '16 at 06:37
  • @SergeiNikulov I have only one boost installation and I link to the correct library. Omiting --toolset=msv-14.0 doesn't work – cevertje400 Apr 07 '16 at 07:41
  • @cevertje400 could you please define BOOST_ALL_NO_LIB for your solution and point to exact libs you want to link? – Sergei Nikulov Apr 07 '16 at 08:24
  • @kenba I tried all three build versions (static,thread,dynamic) but I got the same error. I downloaded the prebuild windows binaries and they work – cevertje400 Apr 08 '16 at 08:29
  • Building boost is a greek tragedy. Just download the [prebuilt binaries](https://sourceforge.net/projects/boost/files/boost-binaries/) – Hans Passant Apr 08 '16 at 10:19
  • @cevertje400 I'm glad to hear that you've got the prebuilt binaries to work. It sounds like the libraries you've built have been built with the wrong version of Visual Studio. I usually build `MSVC` libraries in an `MSBuild Command Prompt for VS2015` instead of a normal command prompt. It ensures that the correct version of MSVC is at the start of your Path and it sets `VisualStudioVersion=14.0`... – kenba Apr 08 '16 at 13:07
  • @kenba I tried building the libaries with the developper commant prompt and the msbuild command prompt of vs2015. But the same linker error remains. :( – cevertje400 Apr 08 '16 at 14:21

0 Answers0