Subject: Re: libraries problem
To: Ruibiao Qiu <ruibiao@arl.wustl.edu>
From: Frederick Bruckman <fb@enteract.com>
List: netbsd-users
Date: 03/14/2001 12:16:54
On Wed, 14 Mar 2001, Ruibiao Qiu wrote:

> On Wed, 14 Mar 2001, Rakhesh Sasidharan wrote:
>
> >The error went of when I linked the above libd2 libraries to /usr/lib (OR
> >used the -L/usr/pkg/lib to cc), but what is The Right Way (TM) to do it
> >:) ?
>
> Which version NetBSD are you running? 1.5 or 1.4 (or earlier)?  If you are
> using a.out binaries, which is 1.4.3 and earlier, you need put /usr/pkg/lib in
> /etc/ld.so.conf, and do a 'ldconfig -v' to update the hints.  On elf platforms
> (1.5 and later), there is no need for that.  See ELF FAQ for details.

Actually, what you need to do for ELF (which also works on
NetBSD/a.out) is to add -Wl,-R/usr/pkg/lib in addition to
-L/usr/pkg/lib. This will add the run-time library path to the
executable. Setting LD_LIBRARY_PATH can be useful for running against
_uninstalled_ libraries, such as when you're developing and debugging.


Frederick