Check The Programming Section
A program consists of several parts called translation units written by different people. Like out "Hello, World!" program consists of two parts
Source code part that we have written
The C++ standard library as part of #include
These separate parts must be compiled and linked together to form an executable code. The program, which links all translation units together is called a linker.
Figure: Stages of Program Linking with Library Code
Note: Object code (.obj) and executables (.exe) are system dependent. Means an object code and .exe generated in Windows system will not work in Linux system.
Library codes are simply written by other and we access them by using the declaration of #include and added that required library as header file (.h). A declaration is a program statement, used to tells the compiler how a specific code can be used.
In the previous section of Compilation we have highlighted a list of common mistakes normally we do during programming. These type mistakes are known as compile-time errors and easy to correct them. If any error occurs during linking of the code with library code, these errors are known as link-time errors and difficult then compile-time errors to correct them. If any error occurs during execution of the code these errors can be run-time or logical errors.