Where are the x64 and ARM Developer Prompts for VS2017?

眉间皱痕 提交于 2019-11-28 12:20:26

The developer prompt bat files seem to have been restructured a little in VS 2017. Instead of having a fixed set of predefined developer prompts, you can customize it even more now.

To get a developer prompt for e.g. arm, add -arch=arm -host_arch=amd64 as parameters to VsDevCmd.bat (e.g. in the shortcut in the start menu).

For the full list of available options, have a look in \Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd\core\parse_cmd.bat, or call "\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd" -help.

I'm not sure if this really is documented anywhere, or if it will be fixed up and/or documented better for the final release of VS 2017.

Installing the insider preview Windows 10 SDK is unrelated to this; the standalone Windows SDK doesn't include any compilers, only headers and link libraries.

Install the Windows 10 SDK and WDK (at least Build 16299) to get the ARM Compiler for Desktop Applications.

Open the Project configuration and create ARM(64) configuration:

If you try to compile it you would get an error that ARM64 is not supported for Desktop:

To fix this, unload the project and open it in editor and add the line <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support> to the debug and release entry for ARM64:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v141</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v141</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
  </PropertyGroup>

and WindowsSDKDesktopARMSupport for 32Bit ARM.

Save changes, load the project again and now compilation works fine:

The 15.9 Update for VS2017, adds official ARM64 support (only for UWP), here the commandline to open ARM64 dev prompt is:

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

32 Bit Arm commandline is:

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86_arm
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!