Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015)
Asked Answered
E

5

58

I get "Unknown compiler version - please run configure tests and report the results" while attempting to compile Boost library on my computer.
I have most recent Boost (as of date of the post) - 1.58.0.
Doesn't Boost support MSVC 14.0, yet? How do I "run the configure tests"?

Screenshots.

Endsley answered 10/6, 2015 at 15:32 Comment(9)
What does the Boost documentation say about that?Snowslide
@AdrianoRepetti: How do I undefine "BOOST_ASSERT_CONFIG"? You may want to see screenshots. I'm not yet even in Visual Studio project. I want to compile lib file first.... Also.. -1? At least explain why.Endsley
@Snowslide To answer your question, docs, says: "The library was successfully built and tested on the following platforms: ... MSVC 9.0 and newer". I don't get it..Endsley
At this point, I'd consider contacting the Boost people directly. They might have a better answerSnowslide
@Endsley well, they obviously meant "MSVC 9.0 and newer available by the date of 1.58 release".Elysian
Since when Boost is a C library?Gloomy
Old question by now, but boost 1.59.0 has official support for VS 2015.Mota
If you use NuGet you can easily upgrade to the newest version of boost hat will works with your compiler.Rosen
Still an issue with Boost 1.65/VS2017Diarist
T
70

Latest (at the time of posting this answer) Boost 1.58 does support MSVC 14.0 Preview which was the latest MS compiler at the time of Boost 1.58 release. Now, the latest version of Visual Studio is 2015 RC which isn't covered in the boost 1.58 config file.

To stop Boost 1.58 complaining about unknown compiler version edit boost/config/compiler/visualc.hpp and replace:

// last known and checked version is 19.00.22129 (VC14 Preview):
#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190022310)

with:

// last known and checked version is 19.00.22816 (VC++ 2015 RC):
#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190022816)

which you can find is already done in boost repo here for upcoming Boost 1.59 release.

Update: For Visual Studio 2015 RTM set it to:

// last known and checked version is 19.00.23026 (VC++ 2015):
#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023026)

Update2: For Visual Studio 2015 Update 1 set it to:

// last known and checked version is 19.00.23506 (VC++ 2015 Update 1):
#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023506)

Also if you have previously been running Boost.Build on toolset=msvc-14.0 then delete from C:\Users\<name>\AppData\Local\Temp the following cached files:

b2_msvc_14.0_vcvarsall_x86.cmd 
b2_msvc_14.0_vcvarsall_x86_amd64.cmd 
b2_msvc_14.0_vcvarsall_x86_arm.cmd

More about that here.

Update3 For future reference, in your Visual Studio Tools Command Prompt run the command cl /Bv to see your version numbers (the parameters are case sensitive).

Mine outputs the following:

C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\cl.exe:        Version 19.11.25506.0
 C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\c1.dll:        Version 19.11.25506.0
 C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\c1xx.dll:      Version 19.11.25506.0
 C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\c2.dll:        Version 19.11.25506.0
 C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\link.exe:      Version 14.11.25506.0
 C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\mspdb140.dll:  Version 14.11.25506.0
 C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\1033\clui.dll: Version 19.11.25506.0

From this you can deduce the _MSC_VER is 1911 (from the text "Version 19.11") and the _MSC_FULL_VER is 191125506.

Trackman answered 20/6, 2015 at 21:38 Comment(2)
At the end - builded successfully. Though, thanks for your information.Endsley
And for the next VS updates, magic numbers can be get by cl command in Visual Studio Command Prompt (2015)Chesterchesterfield
O
38

Edit boost/config/compiler/visualc.hpp and replace the test about the last known and checked version with one of the following line:

1) If you want to deactivate completely the version check:

#if 0

2) If you want to check the major version only (select a single line):

#if (_MSC_VER > 1900) // Visual Studio 2015
#if (_MSC_VER > 1911) // Visual Studio 2017 15.0, 15.1 and 15.2
#if (_MSC_VER > 1911) // Visual Studio 2017 15.3 and 15.4
#if (_MSC_VER > 1912) // Visual Studio 2017 15.5
#if (_MSC_VER > 1913) // Visual Studio 2017 15.6
#if (_MSC_VER > 1914) // Visual Studio 2017 15.7
#if (_MSC_VER > 1915) // Visual Studio 2017 15.8
#if (_MSC_VER > 1916) // Visual Studio 2017 15.9
#if (_MSC_VER > 1920) // Visual Studio 2019 16.0

3) If you want to check both the major and minor version (select a single line):

#if (_MSC_VER > 1900 && _MSC_FULL_VER > 190023506) // Visual Studio 2015 Update 1
#if (_MSC_VER > 1900 && _MSC_FULL_VER > 190023918) // Visual Studio 2015 Update 2
#if (_MSC_VER > 1900 && _MSC_FULL_VER > 190023918) // Visual Studio 2015 Update 3
#if (_MSC_VER > 1910 && _MSC_FULL_VER > 191025017) // Visual Studio 2017 15.0, 15.1 and 15.2
#if (_MSC_VER > 1911 && _MSC_FULL_VER > 191125542) // Visual Studio 2017 15.3 and 15.4
#if (_MSC_VER > 1912 && _MSC_FULL_VER > 191225835) // Visual Studio 2017 15.5
#if (_MSC_VER > 1913 && _MSC_FULL_VER > 191326132) // Visual Studio 2017 15.6
#if (_MSC_VER > 1914 && _MSC_FULL_VER > 191426433) // Visual Studio 2017 15.7
#if (_MSC_VER > 1915 && _MSC_FULL_VER > 191526726) // Visual Studio 2017 15.8
#if (_MSC_VER > 1916 && _MSC_FULL_VER > 191627030) // Visual Studio 2017 15.9
#if (_MSC_VER > 1920 && _MSC_FULL_VER > 192027508) // Visual Studio 2019 16.0
Oscillograph answered 2/12, 2015 at 23:24 Comment(6)
Visual Studio 2017: #if (_MSC_VER > 1910 && _MSC_FULL_VER > 191025017)Expulsive
VS2015U3 is 190024215Spike
Now the latest release VS 2017 full version ends on 7 (not 6), but in boost 1.65 only _MSC_VER is used, so if you only update that part it works fine.Generalship
This is strange, I just updated and the full version on my side is still 191125506Oscillograph
VS2017 v15.5.1 _MSC_VER=1912 _MSC_FULL_VER=191225830Thersathersites
BTW: _MSC_FULL_VER=191426433 is Visual Studio 2017 version 15.7.5. dev.to/yumetodo/list-of-mscver-and-mscfullver-8ndEndgame
R
5

In general, open boost/config/compiler/visualc.hpp and hover the mouse over _MSC_FULL_VER to see the version installed on your environment.

Recalcitrate answered 1/5, 2016 at 13:3 Comment(0)
R
4

Now using the fully released version of msvc-14.0 (Visual Studio 2015), you can use this:

#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023026)

Is there any danger is this? Should we instead wait for the next release of Boost that has been officially edited to have this value?

Ronaronal answered 23/7, 2015 at 20:23 Comment(0)
R
-1

I have tried the following code in Ogre 1.9 - Visual Studio 2015.

Last known and checked version is 19.00.23506 (VC++ 2015 Update 1)

if (_MSC_VER > 1800 && _MSC_FULL_VER > 190023506)

Recent answered 10/3, 2016 at 0:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.