Sign in Join
FPDoc Onlineexperiment

Using a pascal library from a C program

Remark: The examples in this section assume a Linuxsystem; similar commands as the ones below exist for other operating systems, though.

You can also call a Free Pascalgenerated library from a C program: To compile this example, the following command can be used:

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: This can be compiled using the following command:

gcc -o ctest2 ctest2.c -ldl

The -ldl tells gcc that the program needs the libdl.so library to load dynamical libraries.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.