Subject: Re: compiling simple X program
To: Nathan Langford <njl@EastCoastEmail.com>
From: Martin Weber <Ephaeton@gmx.net>
List: netbsd-help
Date: 07/18/2002 18:06:03
On Thu, Jul 18, 2002 at 07:24:42AM -0700, Nathan Langford wrote:
> >[...]
> >3) try with the following: cc -o <binaryname> <sourcefile> -I/usr/X11R6/include -L/usr/X11R6/lib -lX11
> >
> That worked for compiling without errors, but running it
> spits out: "missing libX11.so.6".  I thought the -L... would
> fix that.

Oh heh, forgot it myself. -L (see cc manpage) just tells directories
where to search for libraries at COMPILE time. To find the library
at RUNTIME you should add a -Wl,-R/usr/X11R6/lib, and you'll be fine.

See also: http://www.netbsd.org/Documentation/elf.html

-Martin