Skip to content

Commit 23239c1

Browse files
author
Colin Robertson
committed
Acrolinx even more of the things.
1 parent 67d48c0 commit 23239c1

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

docs/build/building-on-the-command-line.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ ms.assetid: 7ca9daed-a003-4162-842d-908f79058365
88
---
99
# Use the MSVC toolset from the command line
1010

11-
You can build C and C++ applications on the command line by using tools that are included in Visual Studio. You can also download the compiler toolset as a standalone package from the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/) page. It is part of the **Build Tools for Visual Studio** package; you can choose to download only the tools you need for C++ development.
11+
You can build C and C++ applications on the command line by using tools that are included in Visual Studio. The compiler toolset is also downloadable as a standalone package from the [Visual Studio downloads](https://visualstudio.microsoft.com/downloads/) page. It's part of the **Build Tools for Visual Studio** package. You can choose to download only the tools you need for C++ development.
1212

1313
## How to use the command-line tools
1414

15-
When you choose one of the C++ workloads in the Visual Studio Installer, it installs the Visual Studio *platform toolset*. A platform toolset has all the C and C++ tools for a specific Visual Studio version. The tools include including the C/C++ compilers, linkers, assemblers, and other build tools, and matching libraries. You can use all of these tools at the command line. They're also used internally by the Visual Studio IDE. There are separate x86-hosted and x64-hosted compilers and tools to build code for x86, x64, ARM, and ARM64 targets. Each set of tools for a particular host and target build architecture is stored in its own directory.
15+
When you choose one of the C++ workloads in the Visual Studio Installer, it installs the Visual Studio *platform toolset*. A platform toolset has all the C and C++ tools for a specific Visual Studio version. The tools include the C/C++ compilers, linkers, assemblers, and other build tools, and matching libraries. You can use all of these tools at the command line. They're also used internally by the Visual Studio IDE. There are separate x86-hosted and x64-hosted compilers and tools to build code for x86, x64, ARM, and ARM64 targets. Each set of tools for a particular host and target build architecture is stored in its own directory.
1616

1717
To work correctly, the tools require several specific environment variables to be set. These variables are used to add the tools to the path, and to set include file, library file, and SDK locations. To make it easy to set these environment variables, the installer creates customized *command files*, or batch files, during installation. You can run one of these command files to set a specific host and target build architecture, Windows SDK version, and platform toolset. For convenience, the installer also creates shortcuts in your Start menu. The shortcuts start developer command prompt windows by using these command files for specific combinations of host and target. These shortcuts ensure all the required environment variables are set and ready to use.
1818

@@ -30,46 +30,46 @@ The command prompt shortcuts are installed in a version-specific Visual Studio f
3030
- **x86_x64 Cross Tools Command Prompt** - Sets the environment to use 32-bit, x86-native tools to build 64-bit, x64-native code.
3131
- **x64_x86 Cross Tools Command Prompt** - Sets the environment to use 64-bit, x64-native tools to build 32-bit, x86-native code.
3232

33-
The Start menu folder and shortcut names vary depending on the installed version of Visual Studio, and if you set one, the installation **Nickname**. For example, suppose you installed Visual Studio 2019, and you gave it a nickname of *Latest*. The developer command prompt shortcut is named **Developer Command Prompt for VS 2019 (Latest)**, in a folder named **Visual Studio 2019**.
33+
The Start menu folder and shortcut names vary depending on the installed version of Visual Studio. If you set one, they also depend on the installation **Nickname**. For example, suppose you installed Visual Studio 2019, and you gave it a nickname of *Latest*. The developer command prompt shortcut is named **Developer Command Prompt for VS 2019 (Latest)**, in a folder named **Visual Studio 2019**.
3434

3535
## <a name="developer_command_prompt"></a> To open a developer command prompt window
3636

3737
1. On the desktop, open the Windows **Start** menu, and then scroll to find and open the folder for your version of Visual Studio, for example, **Visual Studio 2019**.
3838

3939
1. In the folder, choose the **Developer Command Prompt** for your version of Visual Studio. This shortcut starts a developer command prompt window that uses the default build architecture of 32-bit, x86-native tools to build 32-bit, x86-native code. If you prefer a non-default build architecture, choose one of the native or cross tools command prompts to specify the host and target architecture.
4040

41-
For an even faster way to open a developer command prompt, enter *developer command prompt* in the desktop search box, then choose the result you want.
41+
For an even faster way to open a developer command prompt, enter *developer command prompt* in the desktop search box. Then choose the result you want.
4242

4343
## <a name="developer_command_file_locations"></a> Developer command file locations
4444

4545
If you prefer to set the build environment in an existing command prompt window, you can use one of the command files created by the installer. We recommend you set the environment in a new command prompt window. We don't recommend you later switch environments in the same command window.
4646

4747
::: moniker range=">= vs-2019"
4848

49-
The command file location depends on the version of Visual Studio you have installed, and installation directory and nickname choices you made during installation. For Visual Studio 2019, the typical installation location on a 64-bit system is in \\Program Files (x86)\\Microsoft Visual Studio\\2019\\*edition*, where *edition* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
49+
The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2019, the typical installation location on a 64-bit system is in \\Program Files (x86)\\Microsoft Visual Studio\\2019\\*edition*. *Edition* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
5050

5151
::: moniker-end
5252
::: moniker range="= vs-2017"
5353

54-
The command file location depends on the version of Visual Studio you have installed, and installation directory and nickname choices you made during installation. For Visual Studio 2017, the typical installation location on a 64-bit system is in \\Program Files (x86)\\Microsoft Visual Studio\\2017\\*edition*, where *edition* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
54+
The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2017, the typical installation location on a 64-bit system is in \\Program Files (x86)\\Microsoft Visual Studio\\2017\\*edition*. *Edition* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
5555

5656
::: moniker-end
5757
::: moniker range="< vs-2017"
5858

59-
The command file location depends on the version of Visual Studio you have installed, and installation directory choice you made during installation. For Visual Studio 2015, the typical installation location is in \\Program Files (x86)\\Microsoft Visual Studio 14.0.
59+
The command file location depends on the Visual Studio version, and the installation directory. For Visual Studio 2015, the typical installation location is in \\Program Files (x86)\\Microsoft Visual Studio 14.0.
6060

6161
::: moniker-end
6262

63-
The primary developer command prompt command file, VsDevCmd.bat, is located in the Common7\\Tools subdirectory of the installation directory. When no parameters are specified, this sets the environment and the host and target build architecture to use the 32-bit x86-native tools to build 32-bit x86 code.
63+
The primary developer command prompt command file, VsDevCmd.bat, is located in the Common7\\Tools subdirectory. When no parameters are specified, it sets the environment to use the x86-native tools to build 32-bit x86 code.
6464

6565
::: moniker range=">= vs-2017"
6666

67-
More command files are available to set up specific build architectures, depending on the Visual Studio workloads and options you have installed. In Visual Studio 2017 and Visual Studio 2019, you'll find them in the VC\\Auxiliary\\Build subdirectory of the installation directory.
67+
More command files are available to set up specific build architectures. The command files available depend on the Visual Studio workloads and options you've installed. In Visual Studio 2017 and Visual Studio 2019, you'll find them in the VC\\Auxiliary\\Build subdirectory.
6868

6969
::: moniker-end
7070
::: moniker range="< vs-2017"
7171

72-
More command files are available to set up specific build architectures, depending on the Visual Studio options you have installed. In Visual Studio 2015, these are located in the VC, VC\\bin, or VC\\bin\\*architecture* subdirectories of the installation directory, where *architecture* is one of the native or cross-compiler options.
72+
More command files are available to set up specific build architectures. The command files available depend on the Visual Studio workloads and options you've installed. In Visual Studio 2015, they're located in the VC, VC\\bin, or VC\\bin\\*architecture* subdirectories, where *architecture* is one of the native or cross-compiler options.
7373

7474
::: moniker-end
7575

@@ -92,16 +92,16 @@ These command files set default parameters and call VsDevCmd.bat to set up the s
9292
9393
## Use the developer tools in an existing command window
9494

95-
The simplest way to specify a particular build architecture in an existing command window is to use the vcvarsall.bat file. You can use vcvarsall.bat to set environment variables to configure the command line for native 32-bit or 64-bit compilation. You can specify cross-compilation to x86, x64, ARM, or ARM64 processors. You can target Microsoft Store, Universal Windows Platform, or Windows Desktop platforms, specify which Windows SDK to use, and select the platform toolset version.
95+
The simplest way to specify a particular build architecture in an existing command window is to use the vcvarsall.bat file. Use vcvarsall.bat to set environment variables to configure the command line for native 32-bit or 64-bit compilation. Arguments let you specify cross-compilation to x86, x64, ARM, or ARM64 processors. You can target Microsoft Store, Universal Windows Platform, or Windows Desktop platforms. You can even specify which Windows SDK to use, and select the platform toolset version.
9696

97-
If no arguments are provided, vcvarsall.bat configures the environment variables for using the current 32-bit native compiler for x86 Windows Desktop targets. However, you can use it to configure any of the native or cross compiler tools. It displays an error message if you specify a compiler configuration that's not installed or isn't available on your computer.
97+
When used with no arguments, vcvarsall.bat configures the environment variables to use the current x86-native compiler for 32-bit Windows Desktop targets. You can add arguments to configure the environment to use any of the native or cross compiler tools. vcvarsall.bat displays an error message if you specify a configuration that's not installed or available on your computer.
9898

9999
### vcvarsall syntax
100100

101101
> **vcvarsall.bat** [*architecture*] [*platform_type*] [*winsdk_version*] [**-vcvars_ver=**_vcversion_]
102102
103103
*architecture*<br/>
104-
This optional argument specifies the host and target architecture to use. If *architecture* is not specified, the default build environment is used. These arguments are supported:
104+
This optional argument specifies the host and target architecture to use. If *architecture* isn't specified, the default build environment is used. These arguments are supported:
105105

106106
|*architecture*|Compiler|Host computer architecture|Build output (target) architecture|
107107
|----------------------------|--------------|----------------------------------|-------------------------------|
@@ -152,35 +152,35 @@ Use **-vcvars_ver=14.0** to specify the Visual Studio 2015 compiler toolset.
152152

153153
::: moniker-end
154154

155-
1. Enter the command for your preferred developer environment. For example, to build ARM code for UWP on a 64-bit platform by using the latest Windows SDK and the latest Visual Studio compiler toolset, use this command line:
155+
1. Enter the command for your preferred developer environment. For example, to build ARM code for UWP on a 64-bit platform, using the latest Windows SDK and Visual Studio compiler toolset, use this command line:
156156

157157
`vcvarsall.bat amd64_arm uwp`
158158

159159
## Create your own command prompt shortcut
160160

161161
::: moniker range=">= vs-2019"
162162

163-
If you open the Properties dialog for one of the existing developer command prompt shortcuts, you can see the command target used. For example, the target for the **x64 Native Tools Command Prompt for VS 2019** shortcut is something similar to:
163+
Open the Properties dialog for a developer command prompt shortcut to see the command target used. For example, the target for the **x64 Native Tools Command Prompt for VS 2019** shortcut is something similar to:
164164

165165
`%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"`
166166

167167
::: moniker-end
168168
::: moniker range="= vs-2017"
169169

170-
If you open the Properties dialog for one of the existing developer command prompt shortcuts, you can see the command target used. For example, the target for the **x64 Native Tools Command Prompt for VS 2017** shortcut is something similar to:
170+
Open the Properties dialog for a developer command prompt shortcut to see the command target used. For example, the target for the **x64 Native Tools Command Prompt for VS 2017** shortcut is something similar to:
171171

172172
`%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"`
173173

174174
::: moniker-end
175175
::: moniker range="< vs-2017"
176176

177-
If you open the Properties dialog for one of the existing developer command prompt shortcuts, you can see the command target used. For example, the target for the **VS2015 x64 Native Tools Command Prompt** shortcut is something similar to:
177+
Open the Properties dialog for a developer command prompt shortcut to see the command target used. For example, the target for the **VS2015 x64 Native Tools Command Prompt** shortcut is something similar to:
178178

179179
`%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64`
180180

181181
::: moniker-end
182182

183-
The architecture-specific batch files set the *architecture* parameter and call vcvarsall.bat. You can pass the same options to these batch files as you would pass to vcvarsall.bat, or you can just call vcvarsall.bat directly. To specify parameters for your own command shortcut, add them to the end of the command in double-quotes. For example, to set up a shortcut to build ARM code for UWP on a 64-bit platform by using the latest Windows SDK and a compiler toolset that is earlier than the current version, you need to specify the version number. Use something like this command target in your shortcut:
183+
The architecture-specific batch files set the *architecture* parameter and call vcvarsall.bat. You can pass the same options to these batch files as you would pass to vcvarsall.bat, or you can just call vcvarsall.bat directly. To specify parameters for your own command shortcut, add them to the end of the command in double-quotes. For example, here's a shortcut to build ARM code for UWP on a 64-bit platform, using the latest Windows SDK. To use an earlier compiler toolset, specify the version number. Use something like this command target in your shortcut:
184184

185185
::: moniker range=">= vs-2019"
186186

@@ -200,7 +200,7 @@ The architecture-specific batch files set the *architecture* parameter and call
200200

201201
Adjust the path to reflect your Visual Studio installation directory. The vcvarsall.bat file has additional information about specific version numbers.
202202

203-
## Command line tools
203+
## Command-line tools
204204

205205
To build a C/C++ project at a command prompt, Visual Studio provides these command-line tools:
206206

@@ -211,10 +211,10 @@ Use the compiler (cl.exe) to compile and link source code files into apps, libra
211211
Use the linker (link.exe) to link compiled object files and libraries into apps and DLLs.
212212

213213
[MSBuild](msbuild-visual-cpp.md)<br/>
214-
Use MSBuild (msbuild.exe) and a project file (.vcxproj) to configure a build and invoke the toolset indirectly. This is equivalent to running the **Build** project or **Build Solution** command in the Visual Studio IDE. Running MSBuild from the command line is an advanced scenario and generally not recommended.
214+
Use MSBuild (msbuild.exe) and a project file (.vcxproj) to configure a build and invoke the toolset indirectly. It's equivalent to running the **Build** project or **Build Solution** command in the Visual Studio IDE. Running MSBuild from the command line is an advanced scenario and not commonly recommended.
215215

216216
[DEVENV](/visualstudio/ide/reference/devenv-command-line-switches)<br/>
217-
Use DEVENV (devenv.exe) combined with a command-line switch—for example, **/Build** or **/Clean**to perform certain build commands without displaying the Visual Studio IDE. In general this is preferred over using MSBuild directly because you can let Visual Studio handle the complexities of MSBuild.
217+
Use DEVENV (devenv.exe) combined with a command-line switch such as **/Build** or **/Clean** to execute certain build commands without displaying the Visual Studio IDE. In general, DEVENV is preferred over using MSBuild directly, because you can let Visual Studio handle the complexities of MSBuild.
218218

219219
[NMAKE](reference/nmake-reference.md)<br/>
220220
Use NMAKE (nmake.exe) on Windows to build C++ projects based on a traditional makefile.
@@ -223,10 +223,10 @@ When you build on the command line, the F1 command isn't available for instant h
223223

224224
## In This Section
225225

226-
These articles show how to build apps on the command line, describe how to customize the command-line build environment to use 64-bit toolsets and target x86, x64, ARM, and ARM64 platforms, and demonstrate how to use the command-line build tools MSBuild and NMAKE.
226+
These articles show how to build apps on the command line, and describe how to customize the command-line build environment. Some show how to use 64-bit toolsets, and target x86, x64, ARM, and ARM64 platforms. They also describe use of the command-line build tools MSBuild and NMAKE.
227227

228228
[Walkthrough: Compiling a Native C++ Program on the Command Line](walkthrough-compiling-a-native-cpp-program-on-the-command-line.md)<br/>
229-
Gives an example that shows how to create and compile a simple C++ program on the command line.
229+
Gives an example that shows how to create and compile a C++ program on the command line.
230230

231231
[Walkthrough: Compile a C Program on the Command Line](walkthrough-compile-a-c-program-on-the-command-line.md)<br/>
232232
Describes how to compile a program written in the C programming language.
@@ -238,7 +238,7 @@ Describes how to create and compile a C++/CLI program that uses the .NET Framewo
238238
Describes how to create and compile a C++/CX program that uses the Windows Runtime.
239239

240240
[Set the Path and Environment Variables for Command-Line Builds](setting-the-path-and-environment-variables-for-command-line-builds.md)<br/>
241-
Describes how to start a command prompt window that has the required environment variables set for command-line builds that target x86, x64, ARM, and ARM64 platforms by using a 32-bit or 64-bit toolset.
241+
How to set environment variables to use a 32-bit or 64-bit toolset to target x86, x64, ARM, and ARM64 platforms.
242242

243243
[NMAKE Reference](reference/nmake-reference.md)<br/>
244244
Provides links to articles that describe the Microsoft Program Maintenance Utility (NMAKE.EXE).

0 commit comments

Comments
 (0)