Skip to main content
gcc
December 13, 2015

Compiling C files

image1

Compilation is the translation of source code (the code we write) into object code (sequence of statements in machine language) by a compiler.

The compilation process has four different steps:

  • The preprocessing
  • The compiling
  • The assembling
  • The linking

The preprocessor

1
gcc -E main.c

The compiler

1
gcc -S main.c

The assembler

1
gcc -c main.c

The linker

1
2
gcc main.c
./a.out

or

1
2
gcc main.c -o my_program
./my_program