Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 5

C++ Stages

• Development
• Preprocessing
• Compilation
• Assembling
• Linker
Development Stage
Where the source code is being written and created.

Preprocessing Stage
Where the Preprocessor Statements are evaluated before the most common ones are #include, #define, #if, #ifdef, #ifndef

Compilation Stage
Where the Code is processed by the lexical analyser, syntax analyser and the semantic analyser creating symbol tables and
in some cases assembly code and others object files.

Assembly Stage
In some cases, there is a separate assembly stage, especially if the compiler generates assembly code instead of an
intermediate representation.
Symbol Table
A data structure holding various types of information associated with symbols in a program. To create object files.

Linker Stage
Linking Stage during which all the object files are gathered and linked to build the final executable producing and executable file, may
produce some errors preventing it from generating a working C++ program. The linker uses the symbol table.

Assembly Stage
In some cases, there is a separate assembly stage, especially if the compiler generates assembly code instead of an
intermediate representation.
Libraries
Libraries are precompiled piece of code that can be reused in a program there are two types DLLs are Dynamically Linked Libraries that are
dynamically linked at runtime unlike Lib which are Static Libraries which are linked in the compilation process.

Static Linking
Is the process of linking a program with external libraries during compilation. Can be used on Static Libraries (.lib) or
Dynamic Libraries (.dll)
Dynamic Linking
Is the process of connecting or linking a program with external libraries or DLLs at runtime. the DLL is not linked with the
application at compile-time but is loaded at runtime when needed.
There are two methods to link dynamically:
• Dynamic Linking with Windows (platform) API Functions: The application uses functions like LoadLibrary and
GetProcAddress to load the DLL and obtain references to the functions or data within it. This method allows for
flexibility in loading and unloading DLLs dynamically and is commonly used when using third-party or system-provided
DLLs, this method symbols are resolved using windows API GetProcAddress (platform). This method allow dynamic
binding.
• Dynamic Linking with Import Libraries: Import libraries (.lib files) can be used to facilitate dynamic linking. These
libraries contain information about the DLLs and functions to be loaded. When an application is linked with an import
library, it is not statically linked with the DLL. Instead, the import library provides the necessary information to the
loader to locate and load the DLL at runtime. , this method Symbol tables are updated during the linking phase as the
compiler generates references to the functions in the DLL, but the DLL itself is not loaded at this stage.

Dynamic Binding
Process of determining the actual function or method to call (dll) at runtime, rather than at compile-time.

You might also like