如何在命令行中使用 Visual Studio 编译 x64 代码? [英] How to compile x64 code with Visual Studio in command line?
问题描述
我想使用 Windows 命令行编译一个简单的 hello-world 风格的程序.
I want to compile a simple hello-world-style program using the Windows command line.
cl file_name.c
很简单.现在我想在 64 位中做同样的事情.我该怎么办?
is easy enough. Now I want to do the same thing in 64 Bit. What should I do?
推荐答案
您需要使用发出 x64 代码的 cl.exe 编译器版本.哪个取决于您的设置.
You need to use a version of the cl.exe compiler which emits x64 code. Which one depends a bit on your setup.
让我们考虑一下您在 64 位机器上的情况.为此,您需要使用位于
Let's consider the case you're on a 64 bit machine. For this you'll need to use the compiler which lives at
c:Program Files (x86)Microsoft Visual Studio 10.0VCinamd64cl.exe
c:Program Files (x86)Microsoft visual Studio 10.0VCinamd64cl.exe
如果您使用的是 32 位机器,则需要使用位于
If you're on a 32 bit machine you'll need to use the cross compiler located at
c:Program FilesMicrosoft Visual Studio 10.0VCinx86_amd64cl.exe
c:Program FilesMicrosoft Visual Studio 10.0VCinx86_amd64cl.exe
这篇关于如何在命令行中使用 Visual Studio 编译 x64 代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!