There is a lot of similar questions, but unfortunately they didn't help a lot.
I'm trying to build program from this post, and have an error:
$ gcc `pkg-config --libs --cflags dbus-1` hh.c -o hh
/tmp/ccMabXOg.o: In function `main':
hh.c:(.text+0x18): undefined reference to `dbus_error_init'
hh.c:(.text+0x29): undefined reference to `dbus_bus_get'
hh.c:(.text+0x39): undefined reference to `dbus_error_is_set'
hh.c:(.text+0x5f): undefined reference to `dbus_error_free'
hh.c:(.text+0x80): undefined reference to `dbus_bus_name_has_owner'
hh.c:(.text+0x8f): undefined reference to `dbus_error_is_set'
hh.c:(.text+0x9f): undefined reference to `dbus_error_free'
hh.c:(.text+0xfb): undefined reference to `dbus_bus_request_name'
hh.c:(.text+0x10a): undefined reference to `dbus_error_is_set'
hh.c:(.text+0x11a): undefined reference to `dbus_error_free'
collect2: error: ld returned 1 exit status
There is include <dbus/dbus.h>
, and file present on the system:
# find / -name "dbus.h" -type f
/usr/include/dbus-1.0/dbus/dbus.h
But dbus_error_init
for example present in dbus-errors.h
file:
# grep -r dbus_error_init /usr/include/dbus-1.0/dbus/
/usr/include/dbus-1.0/dbus/dbus-errors.h:void dbus_error_init (DBusError *error);
I'm not C developer and not too much familiar with gcc
and the linker, so any tips/links appreciated.