link failing despite the right linking arguments are presents on command line

Bug #676519 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: gcc-4.5

Following our conversation on #ubuntu-devel, here is the error on a simple project:
$ gcc -o gnome-settings-daemon/gnome-update-wallpaper-cache `pkg-config --cflags --libs glib-2.0 gdk-2.0 gconf-2.0 gnome-desktop-2.0` debian/gnome-update-wallpaper-cache.c

/tmp/ccpqFpTa.o: In function `main':
gnome-update-wallpaper-cache.c:(.text+0x27): undefined reference to `gdk_init'
gnome-update-wallpaper-cache.c:(.text+0x33): undefined reference to `g_option_context_new'
gnome-update-wallpaper-cache.c:(.text+0x53): undefined reference to `g_option_context_add_main_entries'
gnome-update-wallpaper-cache.c:(.text+0x75): undefined reference to `g_option_context_parse'
gnome-update-wallpaper-cache.c:(.text+0x90): undefined reference to `g_printerr'
gnome-update-wallpaper-cache.c:(.text+0x9c): undefined reference to `g_option_context_free'
gnome-update-wallpaper-cache.c:(.text+0xa8): undefined reference to `g_error_free'
gnome-update-wallpaper-cache.c:(.text+0xc5): undefined reference to `g_option_context_free'
gnome-update-wallpaper-cache.c:(.text+0xca): undefined reference to `gdk_screen_get_default'
gnome-update-wallpaper-cache.c:(.text+0xea): undefined reference to `gdk_screen_get_monitor_geometry'
gnome-update-wallpaper-cache.c:(.text+0xef): undefined reference to `gnome_bg_new'
gnome-update-wallpaper-cache.c:(.text+0xf8): undefined reference to `gconf_client_get_default'
gnome-update-wallpaper-cache.c:(.text+0x110): undefined reference to `gnome_bg_load_from_preferences'
gnome-update-wallpaper-cache.c:(.text+0x13c): undefined reference to `gdk_pixbuf_new'
gnome-update-wallpaper-cache.c:(.text+0x164): undefined reference to `gnome_bg_draw'
collect2: ld returned 1 exit status

-> pkg-config expand normally:
$ pkg-config --cflags --libs glib-2.0 gdk-2.0 gconf-2.0 gnome-desktop-2.0
-pthread -DORBIT2=1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/gnome-desktop-2.0 -I/usr/include/startup-notification-1.0 -I/usr/include/atk-1.0 -pthread -lgconf-2 -lgnome-desktop-2 -lgtk-x11-2.0 -lstartup-notification-1 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng12 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0

gcc-4.4 is building it fine.
you can find additional info for a gcc 4.4 build and options there: http://paste.ubuntu.com/532941/
with 4.5: http://paste.ubuntu.com/532940/

I'll attach gnome-update-wallpaper-cache.c to this bug report as well.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
summary: - link failing despite the right link arguments are present
+ link failing despite the right linking arguments are presents on command
+ line
Revision history for this message
Matthias Klose (doko) wrote :

objects before libs on the command line

affects: gcc-4.5 (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Low
Revision history for this message
Sebastien Bacher (seb128) wrote :

I've commited the fix in the vcs for the next upload

Changed in gnome-settings-daemon (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 2.32.1-0ubuntu3

---------------
gnome-settings-daemon (2.32.1-0ubuntu3) natty; urgency=low

  [ Sebastien Bacher ]
  * debian/rules: list the objects to build before the libraries to fix the
    build issues which was workarounded in the previous upload (lp: #676519)

  [ Martin Pitt ]
  * Add 45_support_new_video_key.patch: Have "Super+P" trigger a video mode
    switch. Newer Dell and HP systems have a rather broken BIOS (due to a
    misunderstanding of the spec) which causes FN+F8 to send the
    literal Super+P scan codes instead of a proper KEY_VIDEOMODE scan
    code. Patch by Mike Terry, thanks! (LP: #539477)
 -- Martin Pitt <email address hidden> Sun, 09 Jan 2011 07:13:47 -0600

Changed in gnome-settings-daemon (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.