In
computer science,
linking means taking one or more
objects generated by
compilers and assembling them into a single
executable program. The objects are program modules containing
machine code and
symbol definitions, which come in two varieties: •
Defined or
exported symbols are
functions or
variables that are present in the module represented by the object, and which should be available for use by other modules. •
Undefined or
imported symbols are functions or variables that are called or referenced by this object, but not internally defined. A
linker program then resolves references to undefined symbols by finding out which other object defines a symbol in question, and replacing placeholders with the symbol's address. Linkers can take objects from a collection called a
library. The final program does not include the whole library, only those objects from it that are needed. Libraries for diverse purposes exist, and one or more system libraries are usually linked in by default. ==Dynamic linking==