Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Jul 2006 07:43:08 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Alejandro Pulver <alepulver@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Re: Renaming and symlinking shared libraries
Message-ID:  <20060704074308.9gtr3ucj7ogs8kcs@netchild.homeip.net>
In-Reply-To: <20060703142907.62215dae@phobos.mars.bsd>
References:  <20060701202522.00da2f4e@phobos.mars.bsd> <20060703114027.tj9s4h5mog8ww0ck@netchild.homeip.net> <20060703142907.62215dae@phobos.mars.bsd>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Alejandro Pulver <alepulver@FreeBSD.org> (from Mon, 3 Jul 2006 =20
14:29:07 -0300):

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, 03 Jul 2006 11:40:27 +0200
> Alexander Leidinger <Alexander@Leidinger.net> wrote:
>
>> Quoting Alejandro Pulver <alepulver@freebsd.org> (from Sat, 1 Jul 2006
>> 20:25:22 -0300):
>>
>> > AFAIK the symlinks would be (under lib/, in src->dest form) the
>> > following. This shows the renaming of libtest to libtest-2, with major
>> > version of 2.
>> >
>> > libtest-2.so -> libtest-2.so.2
>> > libtest-2.so.2 -> test2/libtest-2.so.2 (real)
>> >
>> > Inside test2/.
>> >
>> > libtest.so -> libtest-2.so
>> > libtest-2.so -> libtest-2.so.2 (real)
>> >
>> > Then I link a program with "cc -o test -L/usr/local/lib/test2 -ltest".
>> > I did it with lua4 but after linking 'ldd' says it can't find
>> > "libtest.so".
>> >
>> > Have I missed something?
>>
>> You have to ldconfig the test2 directory, else the run-time linker
>> will not find the lib (it doesn't know where to search for it).
>>
>> Bye,
>> Alexander.
>>
>
> Hello.
>
> Thank you for your reply.
>
> But then how do the databases/dbXX ports achieve the same result
> without it? I thought it should find it since there is a symlink
> in /usr/local/lib that points to it. I want that when I compile a
> program with -L/usr/local/lib/test -ltest it actually links to test-2
> for example. Please look at the dbXX ports to see what I mean.

If you link with "-ltest-2" or if you link lib/libtest.so -> =20
lib/test2/libtest-2.so, it should work, else you have to use the new =20
LDCONFIG infrastructure.

Bye,
Alexander.

--=20
One man's constant is another man's variable.
=09=09-- A.J. Perlis

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID =3D B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID =3D 72077137




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060704074308.9gtr3ucj7ogs8kcs>