Comment 3 for bug 1000818

Revision history for this message
RedDwarf (cmorve69) wrote :

In my system it means: -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0

Of those gmodule-2.0, gobject-2.0, glib-2.0, rt and gthread-2.0 already come anyway from gtkmm. But now I noticed that is not only GTK but GTK and GTHREAD (g_thread_init() in plugin.cpp) the missing libs. Updated patch attached.

If you think any of those libraries shouldn't be there it would be better to report the bug to gtk so they fix its .pc file. But notice that even if *right now* -lgio-2.0 is not really needed, it could be in the future. Right now the plugin ends with a DT_NEEDED entry for glib-2.0 even if your code doesn't use a single function or variable from glib. That's because glib/gtk have the weird habit of adding these dependencies in the headers through macros. The macros can change to add dependencies in any future release (they are not breaking anything because they are giving you the libraries through pkg-config, but you are supposed to use them).

Anyway, since you use -Wl,--as-needed only the actually required libraries are added as DT_NEEDED entries in the final plugin. They being in the command line are not a real problem. At least in any modern RPM* system the dependencies are extracted automatically from the pkg-config, so the extra libraries are warranted to be available.

* I don't know if deb files do the same. But if the Debian gtk-devel package doesn't require all the libraries indicated in the "Requires" field of the .pc file IMHO it's a packaging bug. The .pc file is always correct by definition.