Reputation: 29
Is there any way to write, compile and run C programs from the Windows Command Prompt? I mean just like what is possible from the Linux Terminal using the gcc compiler.
Specifically, I want to know how does Microsoft's "cl.exe" C compiler works. How do I install it? Is it possible to simply write a C Program in a text editor like notepad, then compile it using cl.exe from Command Prompt and run it from there?
Note: I do not want any other kind of C programming solutions on Windows, like using 3rd party compilers like Turbo-C, DevC++, etc, or using Unix emulators like MingGW, etc, or even IDE solutions like Visual Studio, Eclipse, etc. I already know about these.
What I want is to use the native Windows platform for console application programming using Microsoft's own cl.exe compiler and standard Windows libraries. Is it possible?
Apologies if I sound too complicated :)
Upvotes: 2
Views: 1243
Reputation: 29579
You ask and answer your own question - there is nothing to it more than downloading the SDK, and using the developer command line to compile a file (cl hello.c
). By using the shortcut to the developer command line, your PATH and other environment variables are correctly set and you're ready to start compiling immediately.
This is the full cl documentation.
Upvotes: 2
Reputation: 6536
This explains how to use the cl.exe command line options. You may need to set your PATH variable correctly for this to work.
Upvotes: 2