Newbie request - compiling with Xlib.h

Dan Nelson dnelson at allantgroup.com
Sat Dec 16 19:48:47 PST 2006


In the last episode (Dec 17), Henry Lenzi said:
> I'm trying to follow the following tutorial for Xlib prpogramming:
> 
> http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html#preface
> 
> However, I can't seem to compile the simple-drawing.c example. I keep
> getting
> 
> 
> >cc simple-drawing.c  -o simple-drawing -L/usr/X11/lib -lX11
> simple-drawing.c:7:22: X11/Xlib.h: No such file or directory

Note that X is in /usr/X11R6, not /usr/X11, so your link option shoudl
read -L/usr/X11R6/lib.

You need -I/usr/X11R6/include as well.  -I is for headers and is used
during the compile step, -L is for libraries and is used during the
link step.  Your commandline is a direct source-to-executable command,
so it requires both.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list