Chapter 7
Linking issues

When you only use Pascal code, and Pascal units, then you will not see much of the part that the linker plays in creating your executable. The linker is only called when you compile a program. When compiling units, the linker isn’t invoked.

However, there are times that linking to C libraries, or to external object files created by other compilers, may be necessary. The Free Pascal compiler can generate calls to a C function, and can generate functions that can be called from C (exported functions).

7.1 Using external code and variables
7.1.1 Declaring external functions or procedures
7.1.2 Declaring external variables
7.1.3 Declaring the calling convention modifier
7.1.4 Declaring the external object code
7.2 Making libraries
7.2.1 Exporting functions
7.2.2 Exporting variables
7.2.3 Compiling libraries
7.2.4 Unit searching strategy
7.3 Using smart linking