GNOME Bugzilla – Bug 755428
[PATCH] explicitly link to all required libraries to avoid failure
Last modified: 2015-10-20 11:47:26 UTC
Created attachment 311892 [details] [review] fix linking problems Hello. While updating the gnome-calculator packages on Debian to 3.18.0 I ran into issues with linking the program... For example: [...] libtool: link: gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wl,-z -Wl,relro -Wl,-z -Wl,defs -Wl,-O1 -Wl,--as-needed -o .libs/gnome-calculator gnome_calculator-gnome-calculator.o gnome_calculator-math-buttons.o gnome_calculator-math-converter.o gnome_calculator-math-display.o gnome_calculator-math-preferences.o gnome_calculator-math-variable-popup.o gnome_calculator-math-window.o gnome_calculator-math-function-popup.o gnome_calculator-math-history.o gnome_calculator-resources.o -Wl,--export-dynamic -pthread -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 ../lib/.libs/libcalculator.so -pthread -Wl,-rpath -Wl,/usr/lib/gnome-calculator /usr/bin/ld: gnome_calculator-math-display.o: undefined reference to symbol 'gtk_source_completion_provider_get_type' //usr/lib/x86_64-linux-gnu/libgtksourceview-3.0.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status [...] (After fixing that, there was also a problem with gcalccmd referencing g_object_unref without linking to gobject-2.0.) The attached patch fixes the build for me.
Patch looks fine but I would not call that variable GCALCCMD instead I would call it GOBJECT.
(In reply to Alberto Ruiz from comment #1) > Patch looks fine but I would not call that variable GCALCCMD instead I would > call it GOBJECT. Not sure why you think GOBJECT is a better name for gcalccmds dependencies. It would be pretty inconsistent with everything else in configure.ac/Makefile.am, eg. gnome_calculator -> GNOME_CALCULATOR. But feel free to go with whatever name you feel is right! Thanks for looking into this bug report!
(In reply to Andreas Henriksson from comment #2) > (In reply to Alberto Ruiz from comment #1) > > Patch looks fine but I would not call that variable GCALCCMD instead I would > > call it GOBJECT. > > Not sure why you think GOBJECT is a better name for gcalccmds dependencies. > It would be pretty inconsistent with everything else in > configure.ac/Makefile.am, eg. gnome_calculator -> GNOME_CALCULATOR. But feel > free to go with whatever name you feel is right! Thanks for looking into > this bug report! Good point. The convention in other modules is to use separate variables per each module, I didn't notice we're not doing this here so yes your patch is consistent. Patch has been pushed to master and backported to the 3.18 branch.
Review of attachment 311892 [details] [review]: Looks good.