What's the difference between VsDevCmd.bat and VsMSBuildCmd.bat in Visual Studio 2015 (CTP 5)?
Both located in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools aka VS140COMNTOOLS.
Looking at the code for VsMSBuildCmd.bat, it sets VS140COMNTOOLS environment variable from the registry, and also adds MSBuild in the PATH.
VsDevCmd.bat does the same plus it adds a bunch of other directories in the PATH and sets a few more environment variables, most of which are used by Visual C++ compiler. Also adds path to TypeScript Compiler.
Related
How can the entry
<MsTestExePath>$(MSBuildProgramFiles32)Microsoft Visual Studio 14.0\Common7\IDE\mstest.exe</MsTestExePath>
in a .proj file be generalised, such that the build works for different licenses of Visual Studio 2019 as well, where mstest.exe is located at
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\Common7\IDE\MSTest.exe
in the case of an enterprise license?
The most generic solution may be to replace the variable parts of the path with msbuild macros, but which ones would that be?
According to this documentation,
The macro
$(VSInstallDir)
returns the path to the installation folder of the Visual Studio version currently used.
The following entry should therefore work for all versions of visual studio, for which mstest.exe is located in the subfolder \Common7\IDE\ under the installation directory:
<MsTestExePath>$(VSInstallDir)Common7\IDE\mstest.exe</MsTestExePath>
I've installed MSVC++ 6.0 in my computer so it has set the environment variables.
Now I've installed MSVC++ 2019 but when I go to
Computer properties->advanced system settings->Environment variables
Include contains only C:\Program Files (x86)\Microsoft Visual Studio\VC98\atl\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\include
and the remaining path, libs... all contains folders of MSVC++6 but not 2019.
I need this because sometimes I want to compile my C++20 code from CMD not from IDE.
I've run as administrator VsDevCmd.bat but it didn't make changes!
So how can I set the environment variables for visual Studio 2019?
Is there a Visual Studio build command macros for determining the version of Visual Studio?
I want a post-build event that runs something in C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\<My MSVS version>, for example C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating\14.0
We have different developers with different versions of Visual Studio installed, and this build event is currently hard-coded.
I looked here but didn't see anything.
I found the build command macro I was looking for. This did it for me:
$(MSBuildToolsVersion)
It resolves to the major-minor version number that I'm looking for (ie, 14.0).
How to get path to provided visual studio "lib" executable (that can be found in C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\) from CMake?
The full path to lib.exe is not directly available. But you could derive it from CMAKE_LINKER:
get_filename_component(_vs_bin_path "${CMAKE_LINKER}" DIRECTORY)
Or you could do this via a script like CMake does this in Windows-GNU.cmake.
I am using Visual Studio 2012 (Update 5) with MS Window Kits 8.0 and .NET Framework 4.5.51209. Recently, I also installed MS Window Kits 8.1.
Now, I have a file: '\windows kits\8.0\include\shared\iprtrmib.h' that failes to include 'mprapidef.h'.
That include file only exists at: '\Windows Kits\8.1\Include\shared\mprapidef.h', which is not in my include path.
My Visual Studio 'Include Directories' is set to: "$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);".
These are my Visual Studio macros:
VCInstallDir: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
WindowsSDK_IncludePath: C:\Program Files (x86)\Windows Kits\8.0\Include\um;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\winrt
When searching, I found a slightly similar question: missing header file on a new installation of visual studio 2012
I tried repairing my Visual Studio installation. I do not want to change the 'Include Directories' for each of my projects. What else should I try?
I installed vs2015 and vs2012, then the same problem occurs,however, I find a solution.
open visual studio project settings,click VC++ Directories, find Include Directories,add the following line to it.
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
One may add the corresponding 8.1 paths to the environment variable.
Maybe it's necessary to do the same thing with the lib environment variable (WindowsSDK_LibraryPath_x86).