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

Guillermo Martínez Jiménez gmjimen at burdjia.com
Tue Feb 10 19:30:14 CET 2009


I'm trying to link a library written in C (Allegro 4.2) on Linux. The
testing program (which is minimal) links without problems but it
raises a runtime error:

#~/test: ./test
./test: symbol lookup error: /usr/local/lib/liballeg.so.4.2: undefined
symbol: _blender_trans24

I've emailed to the library developers and they said "You'll have to find some
way to work around it, e.g. link your bindings with liballeg_unshareable.a and
make sure when you dlopen() it can resolve those symbols.".

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

The file "liballeg_unsharable.a" exists at "/usr/local/lib" so I added
"-Fl/usr/local/lib" at command line but it returns the same error.

What can I do?

I'm using FPC 2.2.2 on Xubuntu 8.04. No Lazarus nor make.

More information about the fpc-pascal mailing list