编译器的选择(x86_amd64, amd64等的区别)

结论

  • 32/64 位系统编译在32位系统上运行 => x86
  • 32 系统上编译64位系统上运行 => x86_amd64
  • 64 系统上编译在64位系统上运行 => amd64

解释

注:以下引自MSDN
The following list describes the various versions of cl.exe (the Visual C++ compiler):

x86 on x86

Allows you to create output files for x86 machines. This version of cl.exe runs as a 32-bit process, native on an x86 machine and under WOW64 on a 64-bit Widows operating system.
Itanium on x86 (Itanium cross-compiler)
Allows you to create output files for Itanium. This version of cl.exe runs as a 32-bit process, native on an x86 machine and under WOW64 on a 64-bit Widows operating system.

x64 on x86 (x64 cross-compiler)

Allows you to create output files for x64. This version of cl.exe runs as a 32-bit process, native on an x86 machine and under WOW64 on a 64-bit Widows operating system.

Itanium on Itanium

Allows you to create output files for Itanium. This version of cl.exe runs as a native process on an Itanium machine.

x64 on x64

Allows you to create output files for x64. This version of cl.exe runs as a native process on an x64 machine.

Vcvarsall.bat argument Compiler Host (either natively or using emulation) Target architecture
“x86” (default) 32-bit Native x86, x64, Itanium x86
“x86_amd64” x64 Cross X86, x64, Itanium x64
“x86_IPF” Itanium Cross X86, x64, Itanium Itanium
“amd64” x64 Native x64 x64
“IPF” or “itanium” Itanium Native Itanium Itanium

你可能感兴趣的:(Programming)