howtos

Marcel Martin marcel.martin at uni-bielefeld.de
Sun Nov 14 10:17:41 PST 2004


On Sunday 14 November 2004 00:57, Kenneth Østby wrote:
> Hey there...
>
> I'm trying  learn myself some dbus hacking, but the two articles I've
> found on the web(the one at freedesktop.org, and Ross Burtons at
> IBM.com) both won't compile on my box.

Here's an excerpt from a mail I wrote to Ross:
-----------
There's a parameter missing in line 27 of dbus-ping-listen.c: Simple fix is to 
add NULL as third parameter to the call of dbus_bus_add_match(). Don't know 
if it's been added to D-BUS lately, I'm using dbus-0.21.

Since compilation of the .c examples isn't entirely trivial another obstacle I 
encountered was that there were no compilation instructions. Naturally it was 
quite easy as soon as I discovered the wonders of pkg-config:
gcc `pkg-config --cflags dbus-glib-1` `pkg-config --libs dbus-glib-1` -o 
dbus-ping-listen dbus-ping-listen.c
gcc `pkg-config --cflags dbus-glib-1` `pkg-config --libs dbus-glib-1` -o 
dbus-ping-send dbus-ping-send.c
-----------

Maybe that helps.

> Now, is there a good tutorial out there? or should I go diving down
> into the Doxygen documentation?

The last time I searched (middle of August) there were very few how-tos on the 
web. Reading actual code might currently be your best option. 
tools/dbus-send.c and tools/dbus-monitor.c in the D-BUS distribution are 
small (and working!) examples of how to use the "raw" C API. As I could not 
use the GLib bindings in my project those were quite instructive to me.
(But you'll need the doxygen manual.)

Marcel



More information about the dbus mailing list