A source code written in the C programming language goes through many intermediate stages while being compiled until it becomes an executable file. These stages are as follows:

  • Pre-processing : some preliminary preparations are applied on the source code to prepare for the compilation process
  • Compilation : the code takes the form of assembly code.
  • Assembling : assembly code becomes machine code and is the last stage before it becomes an executable file. This state of the file is the “object” state
  • Linking : The object file created in the previous stage and the library files are combined to form the executable file

The Basic Compilation flow looks as follows:


While this was a high level overview, the actual process is way more detailed which looks like this :- Compilation and Execution map