4 ms·
I solved this problem in 2017 when they changed things around a bit. CMD /c vcvarsall.bat x64 && set Then dump the VC specific environment variables in a file
by john567 5y ago
I solved this problem in 2017 when they changed things around a bit.
CMD /c vcvarsall.bat x64 && set
Then dump the VC specific environment variables in a file and you are good.
I implemented this in tundra a very nice and fast build system. It's in Lua... you can look at it here https://github.com/deplinenoise/tundra/blob/master/scripts/tundra/tools/msvc-vscommon-next.lua https://github.com/deplinenoise/tundra/blob/master/scripts/t...
- modeless 5y ago'vcvarsall.bat' is not recognized as an internal or external command, operable program or batch file. The problem this code is solving is equivalent to finding vcvarsall.bat in the first place.
- john567 5y agoWhich is trivial. For all versions of Visual Studio it's has always been in the same location. They changed the directory structure somewhat around 2017 but it was a minor change. Also, if you want to run that command you need to run it from the developer command prompt. Otherwise it's location isn't in your path but like I said this script is always in the same location and what it does is that it sets up the environment for you and it's configurable via parameters.
- modeless 5y agoIt is decidedly not trivial because people can and do choose to install Visual Studio to any random path they want. You can't assume that it is in C:\Program Files (x86) or %ProgramFiles(x86)% or anything like that, if you care about making reliable software. And there is no guarantee that future versions won't change the directory structure again. In fact there's practically a guarantee that they will someday. I am well aware that you can use the developer command prompt (in which case you don't need to run that command at all, it would be redundant). But it's a ridiculous and extremely annoying requirement to impose on your users.