An Introduction To GCC Step-By-Step

Programming language C

  • Readability: Programs are easy to read.
  • Maintainability: Programs are easy to maintain.
  • Portability: Programs are easy to port across different computer platforms.

GNU Compiler Collection (GCC)

The process of compilation

The Process of compilation in C
The Process of Compilation in C
  • Pre-processor (Pre-processing)
  • Compiler (Compiling)
  • Assembler (Assembling)
  • Linker (Linking)

The Source Code

The Four Steps of the Compilation Process

  • It will get rid of the comments that you made in the source code.
  • It will include those header files (libraries) that you called in the source code.
  • The pre-processor will replace the macros with their definitions throughout the program.
  • It will link all the sources files together (object files) and can even combine one program with another one. Just to get it simple, it will take, for example, the “secondary.o” and combine it with the “main.o” to make one program.
  • Another thing is that, before all this, the linker will only receive reference of a function. But the linker will resolve those reference and link the object file with the libraries.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store