error comiling a simple application with dbus

Łukasz Pankowski lukpank at
Wed Apr 29 19:05:16 CEST 2009

Anas Alzouhbi <anas.lbn at> writes:

> hello!
> I try to a build simle program which uses d-bus
> my program is too simple, its header contains:  #include <dbus/dbus.h>
> but I obtained this error messaj:  error: dbus/dbus.h: No such file or directory
> should I add any flag to the commands in Makefile, or what I have to
> do

You should be able to compile it with

gcc `pkg-config --cflags --libs dbus-1` foo.c -o foo

if you use plain dbus, or with

gcc `pkg-config --cflags --libs dbus-glib-1` foo.c -o foo

if you use glib bindings to dbus.

More information about the community mailing list