visual studio 命令行工具 Use the Microsoft C++ toolset from the command line

Developer command prompt shortcuts

The command prompt shortcuts are installed in a version-specific Visual Studio folder in your Start menu. Here's a list of the base command prompt shortcuts and the build architectures they support:

  • Developer Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 32-bit, x86-native code.
  • x86 Native Tools Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 32-bit, x86-native code.
  • x64 Native Tools Command Prompt - Sets the environment to use 64-bit, x64-native tools to build 64-bit, x64-native code.
  • x86_x64 Cross Tools Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 64-bit, x64-native code.
  • x64_x86 Cross Tools Command Prompt - Sets the environment to use 64-bit, x64-native tools to build 32-bit, x86-native code.

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.

To open a developer command prompt window

  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.

  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 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.

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.

Developer command file locations

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.

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\editionEdition may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.

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.

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.

These command files set default parameters and call VsDevCmd.bat to set up the specified build architecture environment. A typical installation may include these command files:

TABLE 1
Command FileHost and Target architectures
vcvars32.batUse the 32-bit x86-native tools to build 32-bit x86 code.
vcvars64.batUse the 64-bit x64-native tools to build 64-bit x64 code.
vcvarsx86_amd64.batUse the 32-bit x86-native cross tools to build 64-bit x64 code.
vcvarsamd64_x86.batUse the 64-bit x64-native cross tools to build 32-bit x86 code.
vcvarsx86_arm.batUse the 32-bit x86-native cross tools to build ARM code.
vcvarsamd64_arm.batUse the 64-bit x64-native cross tools to build ARM code.
vcvarsall.batUse parameters to specify the host and target architectures, Windows SDK, and platform choices. For a list of supported options, call by using a /help parameter.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值