The linker needs to know at compile time, where to find not yet defined functions
and procedure. First, to be able to build in the program binary instructions relative
to which shared library has to be charged in memory. Second to test that at least, at
linking time, every single procedure and function will be defined.
Here we tell the linker to search in the file libc.so for missing definitions. It
is the purpose of the instruction {$link c}.The linker will add a prefix lib and a
suffix .so, in the Linux world to find the correct shared object file [5, 4].
It is usually necessary to use also the {$link gcc}to link with libgcc.so if
the C objects were created with GCC. Nonetheless this library might not have been
produced during GCC compilation and therefore can be missing. Therefore, linking
errors might occurs if this linking statement is present as well as if this statement is
missing.
Partager