The C++ build process is roughly as thus:
- All .cpp (and possibly .c) files are compiled:
- First the preprocessor processes the file, it (as required):
- Parses and processes all
#defined macros, storing their definitions in a symbol table (a string to string dictionary). - Parses and processes all
#if,#elifand#endifmacros, thus performing conditional compilation. - Parses and processes all
#included header (.h) files, which includes inserting the contents of the header file into the point at which it was #included (or performs a process that achieves the equivalent effect). - Parses and processes all
#pragmas, implementing their compiler-specific behaviour.- Note that the most common and widely supported
#pragmais#pragma once, which acts as an alternative to include guards.
- Note that the most common and widely supported
- Parses and processes all
- First the preprocessor processes the file, it (as required):
- Other
#pragmaexamples include#pragma omp, which implements 'Open Multi-Processing'