Bug 50958

Summary: Undefined reference to symbol 'g_bus_get_sync' compiling against glib-2-32 at contrib/systemd-update
Product: PackageKit Reporter: Alejandro Leiva <aleiva>
Component: GeneralAssignee: Richard Hughes <richard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: aleiva
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch

Description Alejandro Leiva 2012-06-11 03:42:12 UTC
Trying to compile PackageKit against glib-2-32 and glib-master linking process failed.

The g_bus_get_sync metod is defined in GIO so it's needed to add it to the LDFLAGS.

Trace:

aleiva@lysergic:/opt/gnome-shell/source/PackageKit/contrib/systemd-updates$ make V=1
/bin/bash ../../libtool  --tag=CC   --mode=link gcc -Werror -Wall -Wcast-align -Wno-uninitialized -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Winit-self -Wreturn-type -Wformat-nonliteral -Wformat-security -Wmissing-include-dirs -Wmissing-format-attribute -Wsign-compare -Wuninitialized -Waggregate-return -Wdeclaration-after-statement -Wshadow -Wno-strict-aliasing -Winline -g -O2  -L/opt/gnome-shell/install/lib  -o pk-offline-update pk_offline_update-pk-offline-update.o -L/opt/gnome-shell/install/lib -lgobject-2.0 -lglib-2.0   ../../lib/packagekit-glib2/libpackagekit-glib2.la 
libtool: link: gcc -Werror -Wall -Wcast-align -Wno-uninitialized -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Winit-self -Wreturn-type -Wformat-nonliteral -Wformat-security -Wmissing-include-dirs -Wmissing-format-attribute -Wsign-compare -Wuninitialized -Waggregate-return -Wdeclaration-after-statement -Wshadow -Wno-strict-aliasing -Winline -g -O2 -o .libs/pk-offline-update pk_offline_update-pk-offline-update.o  -L/opt/gnome-shell/install/lib -lgobject-2.0 -lglib-2.0 ../../lib/packagekit-glib2/.libs/libpackagekit-glib2.so -Wl,-rpath -Wl,/opt/gnome-shell/install/lib
/usr/bin/ld: pk_offline_update-pk-offline-update.o: undefined reference to symbol 'g_bus_get_sync'
/usr/bin/ld: note: 'g_bus_get_sync' is defined in DSO /opt/gnome-shell/install/lib/libgio-2.0.so.0 so try adding it to the linker command line
/opt/gnome-shell/install/lib/libgio-2.0.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [pk-offline-update] Error 1
Comment 1 Alejandro Leiva 2012-06-11 03:47:31 UTC
Created attachment 62883 [details] [review]
Patch
Comment 2 Richard Hughes 2012-06-11 08:20:02 UTC
Pushed to master, thanks dude.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.