You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/building-on-the-command-line.md
+32-11Lines changed: 32 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,13 +37,13 @@ translation.priority.mt:
37
37
- "pt-br"
38
38
- "tr-tr"
39
39
---
40
-
# Set up to build C/C++ code on the command Line
40
+
# Build C/C++ code on the command line
41
41
42
42
You can build C and C++ applications on the command line by using tools that are included in [!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)].
43
43
44
44
When you choose one of the C++ workloads in the [!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)] Installer, it installs a command-line toolset that includes the C/C++ compilers, linkers, and other build tools. To work correctly, these command-line tools require several specific environment variables 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, also known as batch files, during installation. You can run one of these command files in a command prompt window to set a specific build configuration. For convenience, the installer also creates shortcuts in your Start menu (or Start page on Windows 8.x) that start command prompt windows by using these command files, so all the required environment variables are set and ready to use.
45
45
46
-
The required environment variables are specific to your installation and to the build configuration you choose, and might be changed by product updates or upgrades. Therefore, we strongly recommend that you use one of the installed command prompt shortcuts or command files instead of setting the environment variables in Windows yourself. For more information, see [Setting the Path and Environment Variables for Command-Line Builds](../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
46
+
The required environment variables are specific to your installation and to the build configuration you choose, and might be changed by product updates or upgrades. Therefore, we strongly recommend that you use one of the installed command prompt shortcuts or command files instead of setting the environment variables in Windows yourself. For more information, see [Set the Path and Environment Variables for Command-Line Builds](../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
47
47
48
48
The command-line toolsets, command files, and command prompt shortcuts that are installed depend on your computer processor and the options selected during installation. At a minimum, the 32-bit, x86-native tools that build 32-bit, x86-native code and 64-bit, x64-native code are installed. If you have a 64-bit processor, the 64-bit native tools that build 32-bit native code and 64-bit native code are also installed. If you choose to install the optional C++ Universal Windows Platform tools, then the 32-bit and 64-bit native tools that build ARM code are also installed.
49
49
@@ -97,23 +97,44 @@ You can use the **store** or **uwp** options to specify the platform type, or ne
97
97
98
98
## To set up the build environment in an existing command prompt window
99
99
100
-
1. At the command prompt, use the CD command to change to the Visual C++ installation directory.
100
+
1. At the command prompt, use the CD command to change to the Visual Studio installation directory. Then, use CD again to change to the subdirectory that contains the configuration-specific command files. For Visual Studio 2017, this is the VC\Ausiliary\Build subdirectory. For Visual Studio 2015, use the VC subdirectory.
101
101
102
-
2. To configure this command prompt window for 32-bit x86 builds, at the command prompt, enter:
102
+
1. To configure this command prompt window to use 32-bit tools to build code for x86 platforms, at the command prompt, enter:
103
103
104
-
`vc\vcvarsall.bat`
104
+
`vcvarsall`
105
+
106
+
1. To configure this command prompt window to use 32-bit tools to build code for x64 platforms, at the command prompt, enter:
107
+
108
+
`vcvarsall x86_amd64`
109
+
110
+
1. To configure this command prompt window to use 32-bit tools to build code for ARM platforms, at the command prompt, enter:
111
+
112
+
`vcvarsall x86_arm`
113
+
114
+
1. To configure this command prompt window to use 64-bit tools to build code for x64 platforms, at the command prompt, enter:
105
115
116
+
`vcvarsall amd64`
117
+
118
+
1. To configure this command prompt window to use 64-bit tools to build code for x86 platforms, at the command prompt, enter:
119
+
120
+
`vcvarsall amd64_x86`
121
+
122
+
1. To configure this command prompt window to use 64-bit tools to build code for ARM platforms, at the command prompt, enter:
123
+
124
+
`vcvarsall amd64_arm`
125
+
106
126
The command file sets the required environment variables for the paths to the build tools, libraries, and headers. You can now use this command prompt window to run the command-line compiler and tools.
107
127
108
128
If you are using [DEVENV](/visualstudio/ide/reference/devenv-command-line-switches) for command-line builds, the environment set by vcvarsall.bat or other command files does not affect your builds, unless you also specify the **/useenv** option.
109
129
110
-
## To open a Developer Command Prompt window
130
+
<aname="developer_command_prompt"></a>
131
+
## To open a developer command prompt window
111
132
112
-
1. On the desktop, open the Windows **Start** menu, and then scroll to the **Visual Studio**folder for your version of Visual Studio. In some versions of Visual Studio, the folder is called **Visual Studio Tools**.
133
+
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 2017**. In some older versions of Visual Studio, the shortcuts are in a subfolder called**Visual Studio Tools**.
113
134
114
-
2. In the **Visual Studio**folder, choose the **Developer Command Prompt** for your version of [!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)] to start a developer command prompt window set up to use the default build configuration of 32-bit, x86-native tools to build 32-bit, x86-native code. If you prefer a non-default build configuration, choose one of the native or cross tools command prompts to specify the host and target architecture.
135
+
2. 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 configuration of 32-bit, x86-native tools to build 32-bit, x86-native code. If you prefer a non-default build configuration, choose one of the native or cross tools command prompts to specify the host and target architecture.
115
136
116
-
An even faster way to open a developer command prompt window is to enter "Developer Command Prompt" in the desktop search box, then choose the desired result.
137
+
An even faster way to open a developer command prompt window is to enter *developer command prompt* in the desktop search box, then choose the desired result.
117
138
118
139
## Command line tools
119
140
@@ -152,8 +173,8 @@ Describes how to create and compile a C++/CLI program that uses the .NET Framewo
152
173
[Walkthrough: Compiling a C++/CX Program on the Command Line](../build/walkthrough-compiling-a-cpp-cx-program-on-the-command-line.md)
153
174
Describes how to create and compile a C++/CX program that uses the Windows Runtime.
154
175
155
-
[Setting the Path and Environment Variables for Command-Line Builds](../build/setting-the-path-and-environment-variables-for-command-line-builds.md)
156
-
Describes how to start a Command Prompt window that has the required environment variables set for command-line builds that target x86, x64, and ARM platforms by using a 32-bit or 64-bit toolset.
176
+
[Set the Path and Environment Variables for Command-Line Builds](../build/setting-the-path-and-environment-variables-for-command-line-builds.md)
177
+
Describes how to start a command prompt window that has the required environment variables set for command-line builds that target x86, x64, and ARM platforms by using a 32-bit or 64-bit toolset.
157
178
158
179
[NMAKE Reference](../build/nmake-reference.md)
159
180
Provides links to articles that describe the Microsoft Program Maintenance Utility (NMAKE.EXE).
Copy file name to clipboardExpand all lines: docs/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,23 +41,27 @@ translation.priority.ht:
41
41
- "zh-tw"
42
42
---
43
43
# How to: Enable a 64-Bit Visual C++ Toolset on the Command Line
44
-
Visual C++ includes compilers that you can use to create apps that can run on a 32-bit, 64-bit, or ARM-based Windows operating system.
44
+
45
+
Visual C++ includes compilers, linkers, and other tools that you can use to create platform-specific apps that can run on 32-bit, 64-bit, or ARM-based Windows operating systems. Other optional Visual Studio workloads let you use C++ tools to target other platforms, such as iOS, Android, and Linux. The default build configuration uses 32-bit, x86-hosted tools to build 32-bit, x86-native Windows code. However, you probably have a 64-bit computer. You can take advantage of the processor and memory space available to 64-bit code by using the 64-bit, x64-hosted toolset when you build code for x86, x64, or ARM processors.
45
46
46
47
> [!NOTE]
47
48
> For information about the specific tools that are included with each Visual C++ edition, see [Visual C++ Tools and Features in Visual Studio Editions](../ide/visual-cpp-tools-and-features-in-visual-studio-editions.md).
48
49
>
49
50
> For information about how to use the Visual Studio IDE to create 64-bit applications, see [How to: Configure Visual C++ Projects to Target 64-Bit Platforms](../build/how-to-configure-visual-cpp-projects-to-target-64-bit-platforms.md).
50
51
51
-
[!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)] includes 32-bit, x86-hosted, native and cross compilers for x86, [!INCLUDE[vcprx64](../assembler/inline/includes/vcprx64_md.md)], and ARM targets. When [!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)] is installed on a 64-bit Windows operating system, 32-bit, x86-hosted native and cross compilers, and also 64-bit, [!INCLUDE[vcprx64](../assembler/inline/includes/vcprx64_md.md)]-hosted native and cross compilers, are installed for each target (x86, [!INCLUDE[vcprx64](../assembler/inline/includes/vcprx64_md.md)], and ARM). The 32-bit and 64-bit compilers for each target generate identical code, but the 64-bit compilers support more memory for precompiled header symbols and the Whole Program Optimization ([/GL](../build/reference/gl-whole-program-optimization.md), [/LTCG](../build/reference/ltcg-link-time-code-generation.md)) options. If you run into memory limits when you use a 32-bit compiler, try the 64-bit compiler.
52
+
When you install a C++ workload in the Visual Studio installer, it always installs 32-bit, x86-hosted, native and cross compiler tools to build x86 and x64 code. If you include the Universal Windows Platform workload, it also installs x86-hosted cross compiler tools to build ARM code. If you install these workloads on a 64-bit, x64 processor, you also get 64-bit native and cross compiler tools to build x86, x64, and ARM code. The 32-bit and 64-bit tools generate identical code, but the 64-bit tools support more memory for precompiled header symbols and the Whole Program Optimization ([/GL](../build/reference/gl-whole-program-optimization.md) and [/LTCG](../build/reference/ltcg-link-time-code-generation.md)) options. If you run into memory limits when you use the 32-bit tools, try the 64-bit tools.
53
+
54
+
## Use a 64-bit hosted developer command prompt shortcut
52
55
53
-
When Visual Studio is installed on a 64-bit Windows operating system, additional Command Prompt shortcuts for the 64-bit[!INCLUDE[vcprx64](../assembler/inline/includes/vcprx64_md.md)]-native and x86 cross compilers are available. To access these command prompts on Windows 8, on the **Start**screen, open **All apps**. Under the installed version of **[!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)]**, open **Visual Studio Tools**, and then choose one of the native-tool or cross-tool command prompts. On earlier versions of Windows, choose **Start**, expand**All Programs**, **[!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)]**, **Visual Studio Tools**, and then choose a command prompt.
56
+
When Visual Studio is installed on a 64-bit Windows operating system, additional developer command prompt shortcuts for the 64-bit, x64-hosted native and cross compilers are available. To access these command prompts on Windows 10, on the **Start**menu, open the folder for your version of Visual Studio, for example **Visual Studio 2017**, and then choose one of the x64 native or cross-tool developer command prompts. To access these command prompts on Windows 8, on the **Start** screen, open**All apps**. Under the heading for the installed version of Visual Studio, open the **Visual Studio** folder (in older versions of Visual Studio, it may be named **Visual Studio Tools**). On earlier versions of Windows, choose **Start**, expand **All Programs**, the folder for your version of **Visual Studio** (and on older versions of Visual Studio, **Visual Studio Tools**).
54
57
55
-
## Vcvarsall.bat
56
-
Any of the compilers can be used on the command line by running the vcvarsall.bat command file to configure the path and environment variables that enable the compiler toolset. Because there are no Command Prompt shortcuts to enable a 64-bit toolset to target x86 or ARM platforms, use vcvarsall.bat in a Command Prompt window to use the 64-bit toolset instead. For more information, see [Setting the Path and Environment Variables for Command-Line Builds](../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
58
+
## Use Vcvarsall.bat to set a 64-bit hosted build configuration
57
59
58
-
The following steps show how to configure a Command Prompt to use the 64-bit native toolset to target x86, x64, and ARM platforms.
60
+
Any of the native or cross compiler tools build configurations can be used on the command line by running the vcvarsall.bat command file. This command file configures the path and environment variables that enable a particular build configuration in an existing command prompt window. For more information, see [Build C/C++ code on the command line](../build/building-on-the-command-line.md).
59
61
60
-
#### To run vcvarsall.bat to use a 64-bit toolset
62
+
The following steps show how to configure a command prompt to use the 64-bit native tools to build x86, x64, or ARM code. First, change to the Visual C++ installation directory. For Visual Studio 2017, this is typically in a directory
63
+
64
+
### To run vcvarsall.bat to use 64-bit tools
61
65
62
66
1. At the command prompt, change to the Visual C++ installation directory. (The location depends on the system and the [!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)] installation, but a typical location is C:\Program Files (x86)\Microsoft Visual Studio *version*\VC\\.) For example, enter:
Copy file name to clipboardExpand all lines: docs/build/msbuild-visual-cpp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,4 +51,4 @@ You can use the **MSBuild** tool to build a Visual C++ application from the comm
51
51
|[How to: Modify the Target Framework and Platform Toolset](../build/how-to-modify-the-target-framework-and-platform-toolset.md)|Demonstrates how to compile a project for multiple frameworks or toolsets.|
52
52
53
53
## See Also
54
-
[Building on the Command Line](../build/building-on-the-command-line.md)
54
+
[Build C/C++ code on the command line](../build/building-on-the-command-line.md)
Copy file name to clipboardExpand all lines: docs/build/nmake-reference.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ translation.priority.ht:
38
38
# NMAKE Reference
39
39
The Microsoft Program Maintenance Utility (NMAKE.EXE) is a command-line tool included with [!INCLUDE[vsprvs](../assembler/masm/includes/vsprvs_md.md)] that builds projects based on commands that are contained in a description file.
40
40
41
-
To use NMAKE, you must run it in a Developer Command Prompt window. A Developer Command Prompt window has the environment variables set for the tools, libraries, and include file paths required to build at the command line. For details on how to open a Developer Command Prompt window, see [Building on the Command Line](../build/building-on-the-command-line.md).
41
+
To use NMAKE, you must run it in a Developer Command Prompt window. A Developer Command Prompt window has the environment variables set for the tools, libraries, and include file paths required to build at the command line. For details on how to open a Developer Command Prompt window, see [Build C/C++ code on the command line](../build/building-on-the-command-line.md).
42
42
43
43
## What do you want to know more about?
44
44
[Running NMAKE](../build/running-nmake.md)
@@ -58,7 +58,7 @@ The Microsoft Program Maintenance Utility (NMAKE.EXE) is a command-line tool inc
[Setting the Path and Environment Variables for Command-Line Builds](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md)
0 commit comments