Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
447 views
in Technique[技术] by (71.8m points)

c++ - Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>AppDataLocalTemp 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 StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x64cl.exe:        Version 19.11.25506.0
 C:Program Files (x86)Microsoft Visual StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x64c1.dll:        Version 19.11.25506.0
 C:Program Files (x86)Microsoft Visual StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x64c1xx.dll:      Version 19.11.25506.0
 C:Program Files (x86)Microsoft Visual StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x64c2.dll:        Version 19.11.25506.0
 C:Program Files (x86)Microsoft Visual StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x64link.exe:      Version 14.11.25506.0
 C:Program Files (x86)Microsoft Visual StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x64mspdb140.dll:  Version 14.11.25506.0
 C:Program Files (x86)Microsoft Visual StudioPreviewProfessionalVCToolsMSVC14.11.25503inHostX64x641033clui.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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...