imm wrote:
> On 30 Sep 2007, at 16:39, Gonzalo Garramuño wrote:
> 
> No - more than likely you are using something different.
> And Greg's makefile uses fltk2-config to get the libs, so his  
> makefile inherently uses whatever fltk2-config uses.
> 

No, I'm using the latest svn.  svn diff shows no differences with my 
stuff.  I looked at the source code and I know that it is broken and why 
that is.

> gcc simple-app-fltk2.o NativeFileChooser.o -L/home/Shared/fltk/lib / 
> home/Shared/fltk/lib/libfltk2_images.a /home/Shared/fltk/lib/ 
> libfltk2.a -lX11 -lXi -lXinerama -lXft -lpthread -lm -lXext -lsupc++ - 
> lpng -lfltk2_images -ljpeg -lz -lm -o simple-app-fltk2

Okay.  Here's the difference.  You are getting fltk2_images.  That's 
clearly not what happens with latest SVN.

Greg sets --use-images in the main makefile, but not in the 
Makefile-fltk2, which is obviously a problem if you run it alone without 
the switch, but regardless of that latest svn of fltk2-config is broken.

If you look at fltk2-config.in (or fltk2-config latest), you will see this:

if test x$use_images = xyes; then
     LDLIBS="-lfltk2_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
     LDSTATIC="$libdir/libfltk2_images.a $LDSTATIC $IMAGELIBS"
fi

That is, unlike other switches, LIBS is not being set for --use-images. 
  However, later this is the stuff printed.

if test "$echo_libs" = "yes"; then
     echo $LIBS
fi

Thus, the libfltk2_images is never printed, regardless of switch.  Even 
if you fix that, you will still get a reference problem due to the order 
of libs and libfltk2_images appearing twice.  It is several bugs in 
fltk2-config.in and configure.in, which has this unneeded crap in it:

IMAGELIBS="-lfltk2_images"

instead of:

IMAGELIBS=""

--


To further test how much fltk2-config is broken, try this:

 > fltk2-config --libs
 > fltk2-config --use-images --libs
 > fltk2-config --ldflags
 > fltk2-config --ldstaticflags
 > fltk2-config --ldflags --libs
 > fltk2-config --ldstaticflags --libs
 > fltk2-config --ldflags --use-images --libs
 > fltk2-config --ldstaticflags --use-images --libs

If your fltk2-config is correctly coded, it should return (on linux):

 > fltk2-config --libs
-lfltk2 -lX11 -lXi -lXinerama -lXft -lpthread -lm -lXext -lsupc++

 > fltk2-config --use-images --libs
-lfltk2_images -lpng -ljpeg -lz -lfltk2 -lX11 -lXi -lXinerama -lXft 
-lpthread -lm -lXext -lsupc++

 > fltk2-config --ldflags
-Wl,-rpath,/usr/local/lib -L/usr/local/lib

 > fltk2-config --ldflags --libs
-Wl,-rpath,/usr/local/lib -L/usr/local/lib -lfltk2 -lX11 -lXi -lXinerama 
-lXft -lpthread -lm -lXext -lsupc++

 > fltk2-config --ldstaticflags
-L/usr/local/lib

 > fltk2-config --ldstaticflags --libs
-L/usr/local/lib /usr/local/libfltk2.a -lX11 -lXi -lXinerama -lXft 
-lpthread -lm -lXext -lsupc++

 > fltk2-config --ldstaticflags --use-images --libs
-L/usr/local/lib /usr/local/libfltk2_images.a  /usr/local/libfltk2.a 
-lX11 -lXi -lXinerama -lXft -lpthread -lm -lXext -lsupc++

Notice that:  fltk2_images should appear only once and that it does not 
appear without the --use-images.

Also, try using --ld-flags and --ldstaticflags and not using either 
flag.  On latest SVN the ONLY way to get the libs is by using 
--ld-flags, which is obviously incorrect.  That should only print the 
flags, not add new libraries or repeat them.

With svn fltk2, --use-images switch does nothing without some other flag 
triggering the printing.

The versions I posted fixes some problems and is simpler, too, albeit 
looking even more at fltk2-config, I realize I did not fix all the issues.

-- 
Gonzalo Garramuño
[EMAIL PROTECTED]

AMD4400 - ASUS48N-E
GeForce7300GT
Kubuntu Edgy

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to