[fpc-devel] link search order

Vittorio Giovara vittorio.giovara at gmail.com
Sun Feb 24 18:05:42 CET 2013


I've opened a bug regarding this
http://bugs.freepascal.org/view.php?id=23948 for better tracking this issue.
Thanks for all the feedback received here.
Vittorio

On Sat, Feb 23, 2013 at 5:50 PM, Vittorio Giovara <
vittorio.giovara at gmail.com> wrote:

> On 22/feb/2013, at 16:59, Tomas Hajny <XHajT03 at hajny.biz> wrote:
>
> > On Fri, February 22, 2013 16:33, Vittorio Giovara wrote:
> >
> >
> > Hi,
> >
> >> yes I was talking about linux. I didn't include much information
> because I
> >> didn't want to confuse people with details.
> >>
> >> In this branch of Hedgewars
> >> https://code.google.com/p/hedgewars/source/list?name=physfslayer we are
> >> using physfs library version 2.1.0.
> >> However many people out there have version 2.0.3 installed and (of
> course)
> >> it doesn't contain many of the APIs present in 2.1.0.
> >> So when libphysfs is not found (or an old one is detected) we provide a
> >> copy of the right physfs and have CMake (our build system) compile and
> >> install it. However even if I hardcode the right path of the right
> library
> >> of the right version, the installed system library takes precedence, and
> >> thus if another version of physfs is installed, hedgewars doesn't link
> any
> >> more.
> >>
> >> I would refrain from using a different library name; looking at the
> >> generated link.res file it seems that the first lib search path is
> >> /urs/lib
> >> and /lib and the custom one (where the right libphysfs resides) is found
> >> only later on. Is there a way to prevent this? I tried to play with the
> >> -Xd
> >> flag but the result didn't change.
> >
> > I don't know enough about the library path setting (I leave commenting on
> > this to others). However, if you require a specific version number of a
> > library (and even distribute that version with your code), explicitly
> > linking to that library version seems to be the appropriate solution from
> > my point of view. Another option may be linking the respective library
> >
>
> As mentioned, I've been doing only static builds so far. Plus I passed
> the linker (with -k) the full path of the library it should link, but
> the system one is somehow always dragged in and linked before my
> command takes effect.
>
> Vittorio
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130224/e00f7607/attachment.html>


More information about the fpc-devel mailing list