Definitions – Compilation

Compilation

Compilation

Compilation is the process that converts high level language into machine level language.

Compilation

Compilation steps:

  1. Preprocessing
  2. Compilation
  3. Linking

 

Preprocesing is responsible for:
-replacing #include directives with the content of the respective files (which is usually just declarations)
-replacement of macros (#define)
-selecting different portions of text depending of #if, #ifdef and #ifndef directives.

Compilation is responsible for:
-Parsing the pure C++ source code and converting it into assembly code for the platform.
-Generates the object files (.o) for the platform.

It’s at this stage that “regular” compiler errors, like syntax errors or failed overload resolution errors, are reported.

Linking is responsible for:
-producing the final compilation output from the object files the compiler generated.

The most common errors are missing definitions or duplicate definitions.

 

Leave a comment

Your email address will not be published.