Re: XForms: startup problems

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 15 Sep 97 19:36:12 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> > 3) "gcc -lX11 -lforms -lm xhello.c -o xhello" gets a message from ld that
> > it can't open -lX11. This is the program from the LJ article.
>
> On my system (rather messed up slackware) I had to include
>
> -L/usr/X11/lib -lXext -lforms -lm
>
> don't ask me why, I know next to nothing about X.

It's not an X thing, it's an installation thing.

Normally, the X libraries live in /usr/lib, which the loader driver
knows about. gnu loader driver steps also know about /usr/local/lib.
They don't generally know about anything else. So, if your libraries
live somewhere non-standard (like /usr/X11/lib) then you have to tll
them where.

BTW, Unix loaders are pretty dumb and search in the order of
appearance on the command line, so

gcc -lX11 -lforms -lm xhello.c -o xhello

is likely to result in unresolved external references. You should
probably call the loader with

gcc -lforms -lX11 -lm xhello.c -o xhello

since libforms.a calls X11 functions.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/