How to compile x64 code with Visual Studio in command line?

后端 未结 7 1228
不知归路
不知归路 2020-12-13 18:50

I want to compile a simple hello-world-style program using the Windows command line.

cl file_name.c

is easy enough. Now I want to do the sa

7条回答
  •  渐次进展
    2020-12-13 19:15

    Kyle is right. It is just a matter of setting the PATH environment variable properly. The regular x86 compiler lives in the vc\bin subdirectory. There are two 64-bit compilers, a 32-bit compiler that generates 64-bit code in vc\bin\x86_amd64 and a 64-bit compiler that generates 64-bit code in vc\bin\amd64.

    The default Visual Studio setup always uses the 32-bit compiler to generate 64-bit code.

    Note that the 64-bit compilers are not installed by default. You'll have to re-run setup.exe if you didn't use the custom install option. And re-run the SP1 installer.

提交回复
热议问题