[fpc-devel] link search order

Tomas Hajny XHajT03 at hajny.biz
Fri Feb 22 15:35:00 CET 2013


On Fri, February 22, 2013 10:59, Vittorio Giovara wrote:


Hi,

> I'm using fpc and trying to link it with a library, let's call it libfoo
> version 2.
>
> The problem I'm facing is that many people have libfoo 1.0 installed and
> that when linking, fpc takes libfoo 1.0 instead of the new libfoo 2.0. Of
> course this causes a link failure as I need many libfoo version 2
> functions.
>
> I set the right library search path but the system search path gets always
> picked first (confirmed by looking at link.res).
> Is there a way to force the order of search path (possibly without
> modifying fpc.cfg or playing with linker flags)?

You don't provide much information about your situation, but I assume that
you talk about Linux here. If you need version 2, you may need to link
explicitly to libfoo.2.so rather just libfoo.so. If you link to libfoo.so
and this is expected to be a symbolic link to the latest installed
version, you may also want to check why people having both libfoo 1.0 and
libfoo 2.0 installed do not have the symbolic link pointing to the later
version. One such reason may be not having the development version of the
respective library installed (at least this may be the case on some Linux
distributions as far as I know).

Tomas





More information about the fpc-devel mailing list