Subject: Re: 1.5_ALPHA and shared libraries (esp. XFree86 4.0)
To: Richard Rauch <rauch@eecs.ukans.edud.localnet>
From: Frederick Bruckman <>
List: current-users
Date: 08/11/2000 08:46:55
On Fri, 11 Aug 2000, Richard Rauch wrote:

> This question still remains, though, re. linking under the new
> shared-library handling:
> > (While I'm posting anyway, a loosely related question: I have some OpenGL
> > type code.  When rebuilding under NetBSD 1.5_ALPHA, I had to not only have
> > ``-L<dir>'' but also ``-Wl,-R<dir>''.  ...well, I assumed that I needed to
> > keep ``-L<dir>''.  (^& Is there a way to avoid this redundancy of
> > specifying library directories twice?)

It's *not* redundant: "-L" gives the path to the library at link time,
"-Wl,-R" gives the path at runtime. The idea is to link against
libraries in the build directory while setting the run-time path to
the final destination. For system libraries, the two may be the
same--but in general, there's no reason to think they're the same,
unless you specify that they're the same.