Subject: Re: xforms and undefined reference to `fl_initialize'
To: None <netbsd-help@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 02/03/2001 23:49:02
Well, I figured out how why my xforms-based program wouldn't build with
libforms.a.

I had the command-line options in the wrong order. This works:

 gcc -I/usr/X11R6/include/X11 -I/usr/X11R6/include test.c -o test
 -L/usr/X11R6/lib -lforms -lXpm -lX11 -lm

This does not:

 gcc -I/usr/X11R6/include/X11 -I/usr/X11R6/include -L/usr/X11R6/lib
 -lforms -lXpm -lX11 -lm test.c -o test

But this would work when the liforms.so exists (and using -lGL). Why does
it matter on the order vs. lib*.so and lib*.a?

My K&R C book is good, but it doesn't cover this. I am now reading the
GCC manual. Any other (online-available) suggestions?

(Also, thank you Frederick for the information about libGL and the xforms
package.)

   Jeremy C. Reed
   http://www.reedmedia.net/