So, I need to build projects in Visual Studio 2005 and Visual Studio 2015 on the same machine (64-but, win10). When switching back to a project built in 2005, Boost thinks I'm still using the 2017 compiler and throws all sorts of errors. Mainly this one: Unknown compiler version
My question: Does Visual Studio 2015 set something on my machine that boost would be looking at to determine the compiler version, or does boost store something? For the life of me, I can't figure out where boost is looking for this information.
I believe this is where boost is checking:
#if (_MSC_VER > 1600)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
# pragma message("Unknown compiler version - please run the configure tests and report the results")
# endif
#endif
Where is _MSC_VER
set?
To build the Boost.Build system for your version of Visual Studio, run the bootstrap.bat file in the corresponding Visual Studio command prompt.
Boost.Build likes to default to higher versions of Visual Studio when it is compiling. When Boost.Build realizes that you have more than one version of Visual Studio installed, it will create environment variables like:
VS140COMNTOOLS --> Visual Studio 2015
VS80COMNTOOLS --> Visual Studio 2005
You can switch from the VC++ 14.0 compiler to the VC++ 8 compiler by:
Once you have done both these steps, your compiler will regenerate the compilation scripts properly and should work.