Visual Studio 2017 - Compiling C++ with older MSVC SDK -


with visual studio 2017, have several ways launch compilation within ide window. there's build menu, built-in command prompt, , cmake integration visual studio 2017 launches cmake.

the command prompt , cmake integration allow users launch compilation older versions of msvc. example, using cmakesettings.json, users can specify generator version 14 so:
"generator": "visual studio 14 2015"

unfortunately, there's fundamental problem in visual studio 2017 window , child processes automatically populated environment variables compiling version 15: equivalent of running vcvarsall.bat.

this problem because in microsoft document, recommendation not run vcvarsall.bat version once version of script has been run once in process. avoid conflicts between variables different versions.

if current version of visual c++ installed on computer has previous version of visual c++, should not run vcvars32.bat different versions in same command window.

https://msdn.microsoft.com/en-us/library/f2ccy3wt(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/f2ccy3wt(v=vs.140).aspx

this subtle problem, because passing generator option cmake takes care of things related msvc versioning. however, part of cmake script or child process launched cmake tries detect visual studio version see vs2017.

so, support generator option in cmakesettings.json, visual studio have provide mechanism cmake process obtain appropriate environment variables generator version specified. include nullifying or somehow removing 2017 specifics created upon opening visual studio 2017.

has else experienced problem , found way solve or workaround it?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -