[fpc-devel] link search order

Vittorio Giovara vittorio.giovara at gmail.com
Sat Feb 23 17:47:56 CET 2013


On 22/feb/2013, at 21:49, Marco van de Voort <marcov at stack.nl> wrote:

> In our previous episode, Vittorio Giovara said:
>> 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)?
>
> Pass -Xd and then your own list of libraries with various -Fl?
>
> Without -Xd some defaults are emitted


I've tried setting -Xd and then -Fl/path/to/right/lib but the system
library is picked first nevertheless.
Plus I need to have the system path in the search path, just in a
different order, otherwise I'd have to hardcore different paths for
every possible arch out there...

Vittorio



More information about the fpc-devel mailing list