ubuntu hoary missing dbus_g_bus_get ?

John (J5) Palmieri johnp at redhat.com
Sun Jun 12 20:27:01 PDT 2005


You need to add dbus-glib-1 to your pkg-config line.  BTW when using
pkg-config you can give it a list of package config files to look at
instead of calling pkg-config for each package.

On Sun, 2005-06-12 at 20:15 -0700, Don Park wrote:
> Hi,
> 	Im trying to get familiar with dbus so i can add it to my
> application (apradar.sf.net). Im reading over the article on linuxjournal
> by robert love (http://www.linuxjournal.com/node/7744/print).
> 
> There is a code snippit that im trying to compile on ubuntu hoary, which
> simply calls dbus_g_bus_get but the method is not found during the linking
> stage.
> 
> im compiling with
> g++ `pkg-config --cflags dbus-1` `pkg-config --cflags glib-2.0` play.cc
> `pkg-config --libs dbus-1` `pkg-config --libs glib-2.0`
> 
> which gives the error
> /tmp/ccjYTfrL.o(.text+0x2d): In function `main':
> : undefined reference to `dbus_g_bus_get'
> collect2: ld returned 1 exit status
> 
> 
> i cant find the method by hand, either:
> 
> donp at orbiter:~/src/playdbus$ nm /usr/lib/libdbus-1.a | grep g_bus_get
> donp at orbiter:~/src/playdbus$
> 
> 
> the installed packages are:
> ii  dbus-1              0.23.4-0ubuntu3     simple interprocess messaging
> system
> ii  dbus-1-dev          0.23.4-0ubuntu3     simple interprocess messaging
> system (development head
> ii  dbus-1-utils        0.23.4-0ubuntu3     simple interprocess messaging
> system (utilities)
> ii  dbus-glib-1         0.23.4-0ubuntu3     simple interprocess messaging
> system (GLib-based share
> ii  dbus-glib-1-dev     0.23.4-0ubuntu3     simple interprocess messaging
> system (GLib interface)
> 
> with gcc 4.0:
> g++ (GCC) 4.0.0 20050301 (prerelease) (Debian 4.0-0pre6ubuntu7)
> 
> and libstdc++6       version   4.0-0pre6ubuntu7
> 
> is this a known problem or am I doing something wrong?
> 
> thanks,
> don
> -- 
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list