The gcc command

The gcc command



What does it do ?

It compiles C programs.


How is it used ?

gcc filename, filename should end with .c, such as assignment1.c


Examples and remarks

If you type in the command gcc assignment1.c, the compiler produces an executable program called a.out

Alternatively, using the -o option of the gcc command gcc -o assignment1 assignment1.c produces the executable program in the file assignment1

The executable program can then be run by typing the command assignment1

-c option of the gcc command gcc -c assignment1.c produces the object file assignment1.o

The executable program assignment1 is then produced by gcc -o assignment1 assignment1.o



next previous table of contents