Phases of Translation
C and C++ programs consist of one or more source files, each of which contains some of the text of the program. A source file, together with its include files (files that are included using the #include preprocessor directive) but not including sections of code removed by conditional-compilation directives such as #if, is called a "translation unit."
Source files can be translated at different times — in fact, it is common to translate only out-of-date files. The translated translation units can be processed into separate object files or object-code libraries. These separate, translated translation units are then linked to form an executable program or a dynamic-link library (DLL). For more information about files that can be used as input to the linker, see LINK Input Files.
Translation units can communicate using:
Calls to functions that have external linkage.
Calls to class member functions that have external linkage.
Direct modification of objects that have external linkage.
Direct modification of files.
Interprocess communication (for Microsoft Windows-based applications only).
The following list describes the phases in which the compiler translates files:
The compiler issues warnings or errors during phases of translation in which it encounters syntax errors.
The linker resolves all external references and creates an executable program or DLL by combining one or more separately processed translation units along with standard libraries.