On Sunday 2008-11-02 20:22, Bob Friesenhahn wrote:

> On Sun, 2 Nov 2008, Jan Engelhardt wrote:
>>
>> I have two libraries in paths that are not searched by default (e.g.
>> /opt/foo/lib). So I have this in my pkgconfig files:
>>
>> foo.pc: Libs:        -L${libdir} -lfoo
>> bar.pc: Libs:        -L${libdir} -lbar
>>
>> The linker will find -lfoo,-lbar and successfully create the output file
>> -- which is an .la library --, but running `ldd` on it says
>> "libfoo.so.0 => not found", and that seems fine to me, since no -rpath
>> was given. So I try to add -rpath in the pkgconfig files:
>
> The -rpath option is for the run-time linker search path.

Which is what I want. The linker finds it no problem (due to -L),
the runtime linker does not.

> It is
> not used to find libraries during compilation.  A normal convention
> for run-paths is to use a ':' to allow specifying multiple
> directories (just like PATH).

Well I cannot do that because the rpaths would be in two separate .pc files.

> You should list any dependency
> libraries via foo_la_LIBADD rather than foo_la_LDFLAGS. Please
> refer to the documentation.

Yes I did that, but there seems to be no solution to this.

# Two projects: /opt/foo with foo,bar.la
# and baz as the second.
        baz_la_LIBADD = -L/opt/foo/lib -lfoo -lbar
        baz_la_LDFLAGS = -module -avoid-version


_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to