After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 328699 - pkg-config --libs gtk+-2.0 listing unneeded libraries
pkg-config --libs gtk+-2.0 listing unneeded libraries
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-01-26 09:23 UTC by Vedran Rodic
Modified: 2006-01-26 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vedran Rodic 2006-01-26 09:23:56 UTC
pkg-config --libs gtk+-2.0 for gtk 2.8 lists libraries that don't need to be linked directly to a program using gtk2 such as pangocairo, cairo, etc. 

The program that just wants to link to gtk2 shouldn't be linked to these libs. 

In addition of making the program binary larger and slower to load this way, it makes the program incompatible with systems that have older versions of gtk+2, though the program itself doesn't use any functionality of the new version or the mentioned libraries.

pkg-config --libs gtk+-2.0 should list just the libs that contain the symbols that are in the public gtk include files.
Comment 1 Owen Taylor 2006-01-26 14:42:37 UTC
pangocairo and cairo are integral parts of the GTK+ API, not having
them part of the pkg-config output would make things inconvenient
for application writers. (And you have to have them in the --cflags
output in any case since gtk.h includes the headers.)

If you want to create a binary that works against older versions
of GTK+ you must, for this and other reasons, compile against that 
older version.
Comment 2 Vedran Rodic 2006-01-26 15:08:32 UTC
Forget about the compatibility part of the issue. i shouldn't expect that kind of compatibility. 

What about the other argument: that you force everybody to link against libraries they don't necessarily use directly? 

Is libX11 also an integral part of the GTK+ API? Not on Windows or on Mac OS X.

and even worse, this kind of scenario could happen: i link the application with pkg-config, and that includes the dependancy on libpango-1.0.so.0. But in the meantime a new version of gtk+ is released that depends on libpango-1.2.so.0. The soname for the gtk+ stays the same. So my app loads libpango-1.0.so.0 and and gtk+ loads libpang-1.2.so.0.. and we get a nice segfault.