Bad Dbus Install, sample program

Havoc Pennington hp at redhat.com
Sat Jun 23 22:53:15 PDT 2007


Hi,

dfeustel at mindspring.com wrote:
> The Install of dbus-1.0 does not copy the file
> dbus-arch-deps.h into /usr/local/dbus-1.0/dbus.
> 

This file should be copied to /usr/local/lib/dbus-1.0/include/dbus since 
it is architecture dependent. (different for x86_64 and x86 for example)

This ends up on the include path if you use the output of
"pkg-config --cflags dbus-1"

> Also, the sample program in the wiki
> (http://dbus.freedesktop.org/doc/dbus-tutorial.html#sample-program-1)
> does not compile. First, because the include file setup is not correct.

It is correct if you build with the output of
"pkg-config --cflags dbus-glib-1"

> Second, because there are undefined functions and variables in the
> sample code. 

Possible (don't know if that code is up to date) but be sure you link
with "pkg-config --libs dbus-glib-1"

Normally pkg-config is used with backticks:

  cc -O2 -g -Wall `pkg-config --cflags --libs dbus-glib-1` foo.c -o foo

Note that ` is not the same as '

Or if you have autoconf set up, use the m4 macros that come with pkg-config.

The man page for pkg-config has some more detail, or look at pretty much 
any desktop-ish open source app's source code for an example.

pkg-config should probably be mentioned in the dbus docs somewhere if it 
isn't, but I guess it's just sort of assumed along with usage of the C 
compiler and so forth so nobody thought to mention it.

Havoc



More information about the dbus mailing list