How to Install V142 Build Tools in Visual Studio 2017
Visual Studio Build Tools now include the VS2017 and VS2015 MSVC Toolsets
Augustin
November 2nd, 2017
点这里看中文版
The Visual C++ Build tools have been a huge success since we introduced them two years ago. The C++ Build Tools were originally released as a standalone installer that only laid down the tools required to build C++ projects without installing the Visual Studio IDE. Many developers have found them useful in environments that don't require a full VS install such as build servers or CI systems. The tools are always kept up-to-date, shipping only the latest supported version of the MSVC compiler toolset.
With Visual Studio 2017's new, flexible installer we were able to move away from our custom C++ Build Tools setup to use the new VS 2017 install experience. As we did in the VS2015 timeframe, we updated the MSVC compiler toolset in the Build Tools to match the VS 2017 v141 compiler toolset. The MSVC compiler toolset in the Visual Studio Build Tools currently has all of the C++17 features and STL fixes from the VS2017 version 15.3 release. When we release VS2017 version 15.5, now available in Preview, we'll update the MSVC compiler toolset in the Visual Studio Build Tools again.
You can download the Visual Studio Build Tools today from visualstudio.com. The Build Tools are licensed as a supplement to your existing Visual Studio license so there's no extra cost to integrate them in your workflow.
Installing the VS2015 MSVC v140 Toolset
Many of you have told us that you still need the MSVC v140 toolset from Visual Studio 2015 to continue building older codebases. We've updated the Visual Studio Build Tools to include the v140 toolset from Visual Studio 2015 Update 3 including the most recent servicing release. You might notice that the compiler toolset build version may not match the version in a full VS 2015 install, even though they are the same compilers. That happens because we build the full Visual Studio and the Visual Studio Build Tools in separate branches that may be built on different days.
The Visual C++ build tools workload in the Visual Studio Build Tools will install the latest v141 toolset from VS2017 by default. The v140 toolset from VS2015 will install side-by-side with the v141 toolset. To install them just select the "VC++ 2015.3 v140 toolset for desktop (x86,x64)" at the bottom of the "Optional" section.
After the product install finishes you can click the "Launch" button on the VS installer to open a Developer Command Prompt for VS2017 with the v141 MSVC toolset in the path and ready to go. But what about using the v140 toolset?
The Build Tools workload creates a couple of folders containing Developer Command Prompt shortcuts for you on the Start menu. Unfortunately, the ones in the Visual Studio 2015 folder don't work. We'll remove these from the setup in a future update of the Build Tools.
The Visual Studio 2017 command prompts work as expected. You can easily modify them to create command prompts for the VS 2015 v140 MSVC tools. If you go into the folder C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build
you'll find four developer command prompts (named vcvars*.bat
). Pick any one and create a copy to edit.
The contents of these files are pretty simple: they all just invoke vcvarsall.bat
with the proper architecture parameter. We'll do the same, but add a new parameter that tells vcvarsall.bat to set up the environment for the v140 toolset: -vcvars_ver=14.0
.
Here's an example of a command to set up the environment for the v140 x86-hosted, x64-targeting tools. Running cl -Bv
shows that the environment is set up for the right version of the tools.
Start using the VS2017 Build Tools
Now that the VS2017 Build Tools include the latest MSVC v140 compilers, we're deprecating the old Visual C++ Build Tools from the VS2015 era. If you still need the v140 tools in your build or CI systems, you should download the Visual Studio Build Tools from visualstudio.com.
If you have any feedback or suggestions for us, let us know. We can be reached via the comments below, via email (visualcpp@microsoft.com) and you can provide feedback via Help > Report A Problem in the product, or via Developer Community. You can also find us on Twitter (@VisualC) and Facebook (msftvisualcpp).
How to Install V142 Build Tools in Visual Studio 2017
Source: https://devblogs.microsoft.com/cppblog/visual-studio-build-tools-now-include-the-vs2017-and-vs2015-msvc-toolsets/