In general, there are 3 things you must do to use a function that resides in an external library or object file:
You must make a pascal declaration of the function or procedure you want to use.
You must declare the correct calling convention to use.
You must tell the compiler where the function resides, i.e. in what object file or what library, so the compiler can link the necessary code in.
The same holds for variables. To access a variable that resides in an external object file, you must declare it, and tell the compiler where to find it. The following sections attempt to explain how to do this.