Subject: Re: compiling simple X program
To: None <njl@EastCoastEmail.com>
From: Chris Wareham <chris.wareham@iosystems.co.uk>
List: netbsd-help
Date: 07/18/2002 16:02:04
Nathan Langford wrote:
> --- Martin Weber <Ephaeton@gmx.net> wrote:
> 
>>On Wed, Jul 17, 2002 at 03:06:40PM -0700, Nathan Langford wrote:
>>
>>>Hi,
>>>
>>>I'm trying to experiment with writing C for X.  I found a simple 
>>>program that just creates a window and then closes it, but the 
>>>include <X11/Xlib.h> line generates the error:
>>>
>>>"X11/Xlib.h: No such file or directory"
>>
>>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.
> 

Try setting the following environment variable, and see if
it fixes your problem:

export LD_LIBRARY_PATH=/usr/X11R6/lib:$LD_LIBRARY_PATH

I'm assuming your using /bin/sh or GNU bash. If this cures
your problem then the dynamic library loader isn't looking
for your X libraries by default.

Chris

-- 
chris.wareham@iosystems.co.uk (work)
cwareham@btinternet.com (home)