Subject: Re: compiling simple X program
To: None <njl@EastCoastEmail.com, netbsd-help@netbsd.org>
From: Chris Pinnock <cjep@fawlty.net>
List: netbsd-help
Date: 07/18/2002 16:17:21
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 adding -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib to your cc flags. 

best wishes,
Chris