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.