STR #1799

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 ]

STR #1799

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:4 - High, e.g. key functionality not working
Scope:3 - Applies to all machines and operating systems
Subsystem:Config Files
Summary:fltk-config and fltk2-config has bugs
Version:1.1-current
Created By:greg.ercolano
Assigned To:mike
Fix Version:1.1-current (SVN: v5985)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text top right image
 
#1 greg.ercolano
17:19 Oct 01, 2007
Gonzalo has identified bugs in fltk2-config which both FLTK1 and FLTK2 seem to have, e.g.

    % fltk2-config --use-images --libs
    /usr/local/lib/libfltk2.a

..seems to be missing the image lib.
Gonzalo wrote that all these appeared to be wrong.. comments are mine.

% fltk2-config --use-images --libs
/usr/local/lib/libfltk2.a
.. missing images.

% fltk2-config --ldflags
-L/usr/local/lib -lfltk2 -lX11 -lXi -lXinerama -lXft -lpthread -lm
-lXext -lsupc++
(..not sure what's wrong with this one.)

% fltk2-config --use-images --ldflags
-L/usr/local/lib -lfltk2_images -lpng -lfltk2_images -ljpeg -lz -lfltk2
-lX11 -lXi -lXinerama -lXft -lpthread -lm -lXext -lsupc++
..-lfltk2_images appears twice.

% fltk2-config --use-images --ldstaticflags
-L/usr/local/lib /usr/local/lib/libfltk2_images.a
/usr/local/lib/libfltk2.a -lX11 -lXi -lXinerama -lXft -lpthread -lm
-lXext -lsupc++ -lpng -lfltk2_images -ljpeg -lz
..bad ordering of libs, images appears twice.

% fltk2-config --ldflags
-L/usr/local/lib -lfltk2 -lX11 -lXi -lXinerama -lXft -lpthread -lm
-lXext -lsupc++

% fltk2-config --ldstaticflags
-L/usr/local/lib /usr/local/lib/libfltk2.a -lX11 -lXi -lXinerama -lXft
-lpthread -lm -lXext -lsupc++
..should probably be -lfltk2.a instead of /usr/local/lib/libfltk2.a
 
 
#2 ianmacarthur
13:48 Oct 03, 2007
Greg said:


% fltk2-config --ldflags
-L/usr/local/lib -lfltk2 -lX11 -lXi -lXinerama -lXft -lpthread -lm
-lXext -lsupc++
(..not sure what's wrong with this one.)

I think the problem with this one (and the ldstaticflags option too), at least in gga's eyes, is that this returns more than just the linker *flags*, it also returns the linker *libs*, so possibly ought to be called --ldlibs or etc.

Perhaps ldflags should return just the linker flags and be used in conjunction with the existing --libs option?

Although - for my money - it is OK as is...

Greg also wrote:

% fltk2-config --ldstaticflags
-L/usr/local/lib /usr/local/lib/libfltk2.a -lX11 -lXi -lXinerama -lXft
-lpthread -lm -lXext -lsupc++
..should probably be -lfltk2.a instead of /usr/local/lib/libfltk2.a


No - I think maybe you need to give the full path here? There's something about the way the gcc linker favours dynamic linking over static linking, and if both libs exist and you *want* to force static linking, you need to give the full path explicitly. Or something. I used to know this stuff, but now...

Anyway - if someone knows better, please post!
--
Ian
 
 
#3 gga
15:05 Oct 05, 2007
Yes, when dealing with static libraries, you need to pass the full path to the library to work around gcc's dumbness.
However, fltk should not set simultaneously set the library path with -Lpath as it does now.
 
 
#4 gga
14:29 Oct 06, 2007
Another possibility with gcc is to take advantage of the -Bdynamic and -Bstatic flags.

# this will make fltk2 link statically, and all other libraries
# following it to link dynamically.
-L/path_to_fltk/lib -Wl,-Bstatic -lfltk2 -Wl,-Bdynamic
 
 
#5 mike
07:56 Nov 20, 2007
-Bstatic and -Bdynamic are non-starters - only GCC supports them, and we need to work around the static/dynamic issue with all compilers, not just GCC.  
 
#6 mike
13:15 Nov 20, 2007
Fixed in Subversion repository.  
bottom left image   bottom right image

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.