[fpc-pascal] Problems linking C library on Linux (*.so & *.a files)

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Feb 10 21:35:54 CET 2009

On 10 Feb 2009, at 19:30, Guillermo Martínez Jiménez wrote:

> I tried to link that library using "{$linklib alleg_unsharable}". It
> linked without error but it raises the same runtime error. Then I
> tried deleting the "{$...}" and adding "-klalleg_unsharable" at
> command line but then it said:
> ...
> /usr/bin/ld: lalleg_unsharable: No such file: No such file or  
> directory
> test.pp(17,1) Error: Error while linking
> ...

Linking with a static library works the same way as linking with an  
object file: Either -k/full/path/to/library.a, or {$l library.a} in  
combination with -Fo/full/path/to/library.

In principle, {$linklib xxx} or -klxxx in combination with -Fl would  
also work if you use the -Xt parameter (so the linker looks for static  
libraries -- but then it will try to link every single library  
statically, which is probably not what you want).


More information about the fpc-pascal mailing list