Custom program name with gcc

changomarcelo

Friend of the elves
When I complile/link a C source file with the gcc command I type

gcc file.c

Then, I get a file, in the same directory called a.out. If I want to run the program, I type ./a.out and every thing runs OK.

However, I would like to be able to name the "a.out" file with a different name, because it overwrites all the previous programs I had in the directory. Do you know how to do this?
Thank you
 
gcc -o yaywheefun file.c

that will give you an executable named yaywheefun from the file file.c

Brian
 
thank you btoneill. Where can I find more gcc comand options like this? is there any tutorial in the web that you know?
 
Back
Top