I'm trying to write a small program to use the DBus API, but I cannot get it to compile.
Code:
#include <dbus/dbus.h>
int main(int arc, char* args[]) {
DBusError err;
DBusConnection* conn;
dbus_error_init(&err);
conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
return 0;
}
When I try compiling it using
gcc -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include main.c I get the following errors:
Code:
main.c:(.text+0x18): undefined reference to `dbus_error_init'
main.c:(.text+0x2b): undefined reference to `dbus_bus_get'
System: Fedora 9; x86
I have the development files installed, and when I edit the files in an editor (Anjuta, or Eclipse/CDT) the functions are suggested by their autocomplete functions, so I assume they should work.
Anybody know what I might be missing, or what I can do to make this work?