RemarkThe examples in this section assume a linux system; similar commands as the ones below exist for other operating systems, though.
You can also call a Free Pascal generated library from a C program:
Listing: progex/ctest.pp
gcc -o ctest ctest.c -lsubs
provided the code is in ctest.c.
The library can also be loaded dynamically from C, as shown in the following example:
Listing: progex/ctest2.pp
gcc -o ctest2 ctest2.c -ldl
The -ldl tells gcc that the program needs the libdl.so library to load dynamical libraries.