FLTK logo

STR #2918

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.3 | SVN ⇄ GIT ]

STR #2918

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Build Files
Summary:fltk-config adds unneeded libraries
Version:1.3-feature
Created By:RedDwarf
Assigned To:cand
Fix Version:Will Not Fix
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 RedDwarf
04:42 Jan 17, 2013
fltk-1.3.2-do_not_add_unneeded_extra_dependencies.patch
0k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 RedDwarf
04:42 Jan 17, 2013
A package that uses fltk-config to link against a dynamic version of fltk may fail to build with errors like

/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -lXft
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -lfontconfig
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -lXinerama

(toycars, real case)

Even if the package doesn't use Xft, fontconfig or Xinerama.


The attached patch fixes the problem by not adding those libraries.
 
 
#2 ianmacarthur
13:59 Jan 17, 2013
I can't see how this patch can be correct for the general case where the linked libs refferd to are needed...

In the general case, XFT et al will be needed, so removing them from the link, as shown in this patch, seems wrong.

Perhaps the OP's system does not use or provide these libs? That does seem odd though, nowadays, unless it is a cut down system, or embedded, or something?

In any case, I suspect the problem lies elsewhere - probably makeinclude or configure should not be setting those libs into the "@LIBS@" symbol, if they are not needed by the system.

Anyone have a view on this?
 
 
#3 greg.ercolano
14:25 Jan 17, 2013
Agreed Ian. OP, what's your config.log say about these:

HAVE_LIBFONTCONFIG
USE_XFT
HAVE_XINERAMA

If they're 1 and you want them off, have you tried rebuilding FLTK, first using ./configure to --disable those features you don't want to use.

Though the app might not use those features, FLTK will (if they're on, which is the default).. so if you don't want FLTK to use them, you have to build FLTK with those features disabled.
 
 
#4 RedDwarf
15:24 Jan 17, 2013
I want fltk to use these libraries. I don't want toycars to (directly) use them.

"$LDLIBS" is the list of libraries fltk needs, not the list of libraries toycars needs.


If my program needs fltk I will create the binary with

cc -o my_program my_program.c -lfltk

not with

cc -o my_program my_program.c -lfltk -lXft -lfontconfig -lXinerama

Because my program doesn't (directly) use Xft, fontconfig nor Xinerama.


Yes, you can call it a "cut down" system. It's a system that has

/usr/lib/libXft.so.2.3.1
/usr/lib/libXft.so.2

installed. But doesn't has

/usr/lib/libXft.so

installed. And it's not installed because I don't need it.
 
 
#5 RedDwarf
15:29 Jan 17, 2013
In pkg-config terms, it would be

---------------------------------------------
Libs: -lfltk
Libs.private: -lXft -lfontconfig -lXinerama
---------------------------------------------

And "pkg-config --libs fltk" would return ONLY "-lfltk".
 
 
#6 cand
07:29 Aug 21, 2014
The patch would break static linking.

fltk-config --ldflags is also used in the static case.
 
 
#7 cand
05:29 Jun 03, 2016
I've found that modern linkers *require* all libs to be specified, even if the app directly doesn't depend on them, but only a lib does. As such, this patch is altogether wrong, even in the shared case, and I'm closing this STR.

OpenSuse should also drop this patch, it is breaking apps.
 
     

Return to Bugs & Features ]

 
 

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