[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking against indirect dependencies

From: Szombathelyi Gy÷rgy
Subject: Re: Linking against indirect dependencies
Date: Sat, 29 May 2004 03:31:57 +0200
User-agent: KMail/1.6.52

Friday 28 May 2004 09:27 d├ítummal ezt ├şrta:

> And there's another problem.  When libtool passes -ldependency in the
> command line, the linker will look for libdependency in the
> directories where it looks for libraries (-L).  If libdependency is
> only brought in by another shared library that has it in DT_RPATH,
> libdependency will be looked for in the --rpath-link search path, and
> it will have to be a shared library, i.e., static libs will be
> ignored.
> Now consider the following scenario:
> - is linked with, but was PIC and
>   static-only.  Both are installed.
> - libdep is rebuilt as both static and shared, and reinstalled.
> - program links with, using symbols from that
>   weren't brought into
> - libtool sees is available as a shared lib, so it drops it
>   from the link command.  Link fails because doesn't bring
>   in libdep.a.
AFAIK it's possible to link in libdep to libfoo if libdep is static (at least 
I'm succeeded with a small test case), and then the program not need to link 
with libdep.

I tried:
gcc -c libdep.c
gcc -c libfoo.c
ar q libdep.a libdep.o
ld libfoo.o -o -shared -ldep -L.
gcc prog.c -o prog -lfoo -L.

Or am I wrong?


Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a 
Probald ki most!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]