So I have MinGW and with tweaking, I can run GCC in my CMD. What format do I need to have the file in to run it from the CMD? I tried simply just saving a notepad2 file in C scheme and it won't recognize it.

link|improve this question
feedback

1 Answer

Seems like you are skipping over the fundamentals of compiling source code into binary executables. You should read up on that. But to cut to the chase, if you have a C program that you have typed into an editor, and saved into a file with .c extension -- let's use bedbug.c for example -- then you would use GCC with the command:

gcc bedbug.c -o bedbug

which if completely successful will say absolutely nothing. But you will then have a bedbug.exe that you can run simply by typing bedbug at the CMD prompt. You need to specify the -o part to give the name of the .exe, otherwise it will, for historical reasons, create a file named a.exe (which you could then rename as a separate step, but that's not how people usually do it).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.