各种 Visual C++ 编译工具 prompt command 区别

默认工具

  • 名称

    • Developer Command Prompt for VS 2019
    • 名称上不写平台
  • 机理

    • 使用 x86 工具集 制作 x86 程序
  • 对等编译工具

    • x86 Native Tools Command Prompt

原生工具

用途

  • 生成单一平台程序

x64 native

  • 作用

    • 制作原生 x64 程序
  • 机理

    • 使用 x64 工具集 编译生成 x64 程序

x86 native

  • 作用

    • 制作原生 x86 程序
  • 机理

    • 使用 x86 工具集 制作 x86 程序
  • ??? 是否必须在 x86 机器上使用

交叉工具 cross compiler 交叉编译器

用途

  • 在一个平台上制作适合另一个平台的程序

x86_x64 cross

  • 作用

    • 制作 x64 程序
  • 机理

    • 使用 x86 工具集 制作 x64 程序

x64_x86

  • 作用

    • 制作 x86 程序
  • 机理

    • 使用 x64 工具集制作 x86 程序

命令行启用编译器

  • 调用命令 vcvarsall.bat

    1
    
      cmd /c mklnk D:\soft\bin\vcvarsall.bat "D:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat"
    • 创建快捷链接
  • 命令选择

      For example:
      vcvarsall.bat x86_amd64
      vcvarsall.bat x86_amd64 10.0.10240.0
      vcvarsall.bat x86_arm uwp 10.0.10240.0
      vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
      vcvarsall.bat x64 8.1
      vcvarsall.bat x64 store 8.1