title: How to compile a basic D-Bus/glib example?
body: <p>I'm trying to learn how to use D-Bus with C bindings. I've never used D-Bus before. I'm following this <a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html">tutorial</a>, which I assume is the official one (Freedesktop.org). I've read it until this <a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html#sample-program-1">paragraph</a> that gives a first sample program
  , but unfortunately I don't see any indication on this page about how to compile it or which libraries to include. Did I miss something ?</p>
  
  <p>My OS is Ubuntu 10.04 32bit. I installed the <code>libdbus-glib-1-dev</code> package. I tried to add <code>#include &lt;dbus/dbus.h&gt;</code> at the beginning of the source file, and to compile with</p>
  
  <pre><code>$ gcc -ldbus-1 -I/usr/include/dbus-1.0/ -I/usr/lib/i386-linux-gnu/dbus-1.0/include -o my_dbus.bin my_dbus.c
  </code></pre>
  
  <p>but I just keep failing:</p>
  
  <pre><code>my_dbus.c: In function ‘main’:
  my_dbus.c:7:3: error: unknown type name ‘DBusGConnection’
  my_dbus.c:8:3: error: unknown type name ‘GError’
  ...
  </code></pre>
  
  <p>Did I miss a point in the tutorial ? It not, could you please help me compile this piece of code ?</p>
  
  <p>Thanks in advance.</p>