I am totally new to using gcc. Can someone tell me how i would compile a file called file.c in gcc? Once I compile file.c will I have to run any other commands in order to run the compiled file that gcc made?
Critter
Printable View
I am totally new to using gcc. Can someone tell me how i would compile a file called file.c in gcc? Once I compile file.c will I have to run any other commands in order to run the compiled file that gcc made?
Critter
Easy...
At the prompt type:
gcc file.c -o file
gcc = compiler
file.c = file to compile
-o = create output and send to..
file = final compiled product
Assuming no errors, to run it you'd type ./file
if its a windows system your working on the "-o file" would be changed to "-o file.exe" or whatever namne you want to give the exe
of course then you'd call the file by path and name to run it (c:\gcc\projects\file or whatever)