C++
C++ is a general-purpose programming language created as an extension of the C programming language.
Index
Libraries
A library is a collection of resources used by programs. These resources may include code, data, templates, documentation, etc.
There are 2 types of libraries, static and dynamic.
- Static files (
lib
) can contain eitherstatic
libraries (containing object files) orimport
libraries (containing symbols to allow the linker to linkdll
orso
files). - Dynamic files (
dll
orso
) containdynamic
libraries.
When linking is performed during the creation of an executable or an object file, it is known as static linking (early binding). In this case, the linking is usually done by a linker, but may also be done by the compiler.
When linking is performed while a program is being loaded (load time) or executed (runtime), it is known as dynamic linking (late binding).
Dynamic libraries have 2 types of linking.
- Implicit. When a
lib
file is provided by thedll
creator along with appropriate headers. Thislib
is animport
library, merely a descriptor of the target library, it contains entry point, addresses, etc. It doesn't contain any code and must be passed to the linker. - Explicit. When the library is manually loaded with
LoadLibrary
functions. Thelib
file isn't needed, but it requires more effort to find exports, addresses, and call functions through pointers.