Subject: Re: Why do I need to add an entry into ld.so.conf?
To: Phil Pereira <phil@bsdnexus.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-net
Date: 03/23/2005 20:48:49
[ this is quite off-topic for tech-net ]
On Wed, Mar 23, 2005 at 07:40:02PM +0000, Phil Pereira wrote:
> Hey all,
>
> I'm a little confused by an issue I'm having.
>
> The pkgsrc collection builds fine and I've *never* needed to change anything to have an app complie and work.
>
> Yesterday I downloaded the app wmswallow and tried to build it. All seemed to go well, and the app itself compiled. However - upon trying to run the program I was told that a certain .so file could not be found :(
>
> I used "ldd" to determine that, in fact, a couple of dependencies could not be found.
>
> I added "/usr/X11R6/lib" to ld.so.conf and all worked fine - including the app. "ldd" showed links to the correct dependencies.
>
> My question : If I *never* need to add anything to ld.so.conf to compile an app in pkgsrc, why did I need to add it for a program I compiled myself? What am I missing? Or what did I get wrong?
The gcc flags passed at link time:
-L tells the linker where to find the library at link time
-Wl,-R tells the dynamic loader where to find the libraries at run time.
I guess the application was linked with -L (otherwise it wouldn't have worked)
but without -Wl,-R
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--