
Loader - The operating system loads a binary off of the disk, which contains all the information needed to build the program image. Now the binary sits on disk, which is waits until. You need to tell the linker where it should find all those unresolved externals from the previous stage or they will show up as errors here. Linking - This takes all your object files and puts them into a coherent binary, be it a dynamic shared object or an executable. Object files are almost machine code, but they have a lot of "unresolved externals," which you can kind of think of as pointers to actual function definitions. cpp file is internally translated to assembly for a specific architecture.Īssemble - Generates object files from the generated assembly. Translation - This is where the high-level code (in C, Fortran or whatever) is translated into assembly code by translation unit. A general explanation of terms used to link libraries in C++ dll), the binary is created with calls to the global offset table and you inform the linker that you wish to link with the shared object and the operating system loader builds the proper image when you run the program. lib) along with all the object files into the binary itself. For static libraries, you compile the static archive (.


When creating the final executable, you combine all the object files into a single binary.

c or whatever files, each translation unit (that is, each file) generates an object file. This would probably interest you, but here is a short version:
