Basic GCC Commands For C Language

GCC, GNU Compiler Collection is a free compiler system produced by the GNU project. If you are just doing some bare bone compiling in C, the following commands are what you would need:

1. Compile

gcc -c <name of file>.c

The -c option tells the compiler to only compile the source files and not link them together. The command will create object files (files with .o extension) of each .c files

2. Link

gcc *.0 -o <name of an executable file>

The above command will link all the object files created in the previous step and create an executable file of the given file name.

You can run the executable file by typing ./<name of the executable file> in the command prompt from within its directory