Subject: Re: Where do I get libX11?
To: Adrian P. Ireland <aireland@indigo.ie>
From: Mike Pumford <mpumford@black-star.demon.co.uk>
List: port-arm32
Date: 09/17/1997 18:31:03
On Tue, 16 Sep 1997, Adrian P. Ireland wrote:

> Hi there,
> 
> I found libX11
> the headers are in 
> /usr/X11R6.1/include/X11
> and the library archive is in
> /usr/X11R6.1/lib/libX11.a
> 
> Thanks to Thomas Boroske for that.
> 
> 
> My program (Angband actually) uses these header files in main-x11.c
> ..[snip from main-x11.c]...
> #include <X11/Xlib.h>
> #include <X11/Xutil.h>
> #include <X11/keysym.h>
> #include <X11/keysymdef.h>
> ..[end of snip from main-x11.c]...
> 
> The relevant bits from my makefile are
> ..[snip from Makefile]...
> # Changed by Adrian to stop the standard compilation
> CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" \
>  -I/usr/X11R6.1/include/
                         ^
This is not necessary and may cause the problems you describe.

> LIBS = -L/usr/X11R6.1/lib/libX11.a -lcurses -ltermcap
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think this will cause a link problem. It should probably read:
LIBS = -L/usr/X11R6.1/lib -lX11 -lcurses -ltermcap

> #original LIBS
> #LIBS = -lX11 -lcurses -ltermcap
[snipped link errors]
> 
> Can I check the contents of libX11.a somehow?
> Do I need to include some of the other *.a files?
>
If what I  have suggested does not fix things then you can find out the
names of functions in .a files with the nm command. See man nm for more
details. Depending on what version of X11 the program was written with it
may indeed require more of the X libraries to be linked.

One other not -lname looks for a library called libname.a on the library 
search path. The library search path is set up with the -L compiler
option.

Mike