Separate compilation
The interface file
hash.h
|
typedef . . . HASHTABLE; |
The supplier file hash.c
|
#include "hash.h" |
|
% cc -c hash.c |
This produces an object file hash.o whose symbol
table defines the external
symbols global_hash_data and
lookup.
The client file hashtest.c
|
#include "hash.h" |
|
% cc -c hashtest.c |
This produces an object file hashtest.o containing
unresolved references to
....external symbols
lookup and global_hash_data.
|
% cc -o hashtest hash.o hashtest.o |
This resolves the dangling references in
hashtest.o using the definitions
....in
hash.o, and produces an executable file
hashtest. No compilation
... is done, only
linking and loading.