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 same thing in 64 Bit. What should I do?
To access these command prompts on Windows, on the Start menu, open the folder for your version of Visual Studio, and then choose one of the x64 native or cross-tool developer command prompts.
x64 Native Tools Command Prompt - Sets the environment to use 64-bit, x64-native tools to build 64-bit, x64-native code. x86_x64 Cross Tools Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 64-bit, x64-native code.
Start in Visual StudioOn the menu bar, select Tools > Command Line > Developer Command Prompt or Developer PowerShell.
Run cl from a Visual Studio x64 Command Prompt.
You need to use a version of the cl.exe compiler which emits x64 code. Which one depends a bit on your setup.
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.0\VC\bin\amd64\cl.exe
If you're on a 32 bit machine you'll need to use the cross compiler located at
c:\Program Files\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\cl.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With