Rodolfo Delgado
2 min readFeb 10, 2021

--

Steps of compilation

Before talking about “steps of compilation” it is necessary to explain some concepts.

What is source code?

It is a set of code written using a human-readable programming language.

Which is the object code?

The Object Code is a set of instruction codes that a computer understands. This object code occurs when an interpreter or compiler translates the source code into recognizable and executable machine code.

What is a compilation?

Compilation is a process of converting source code into a Code object. The compilatior checks the source code for structure and syntax errors. If it has no errors, it will generate the code object.

What is GCC?

“GNU Compiler Collection” it is a compiler capable of recive a source program in the C, C++, Fortran, ObjectiveC languages. Generating a binary executable program.

The command to compile is …

The compilation process is divided into 4 steps.

Pre-processing, Compiling, Assembling and Linking

Pre-processing:

It’s a text tool which replaces and gives instructions to the compiler to do required pre-processing before the actual compilation, for example, removing the comments.

Compiler:

It takes the output of the preprocessor and generates assembly language, an intermediate human readable language.

Assembler:

The assembler will convert the assembly code into object code.

Linker:

The linker merges all the object code into a single one. If the code are using a function from libraries, linker will link the code with that library function code.

--

--