- An object file (.o) contains a table of symbols used
in the corresponding source file (.cxx)
- The symbols whose definition was given in the corresponding
source file are resolved
- The symbols whose definition is found in another source file
are unresolved
- Unresolved symbols in an object file can be resolved by linking the object with another object file containing the
missing definitions
- An executable cannot contain any unresolved symbol
- A group of object files file1.o, ..., fileN.o
can be linked together as a single executable file by the
command c++ -o file file1.o ... fileN.o only
if:
- the symbol main is resolved exactly once in
exactly one object file in the group
- for each object file in the group and for each
unresolved symbol in the object file, the symbol must be
resolved in exactly one other file of the group
Leo Liberti
2008-01-12