I'm creating a project with cmake and c where I need to include headers from different folders,
#include <dbus/dbus.h>
#include <audacious/audctrl.h>
#include <audacious/dbus.h>
#include <pidgin/pidgin.h>
And I added these lines to the cmake cofig file:
target_include_directories(untitled PRIVATE
/usr/include/dbus-1.0/;/usr/lib/x86_64-linux-gnu/dbus-1.0/include/;/usr/include/glib-2.0/;
/usr/lib/x86_64-linux-gnu/glib-2.0/include/;/usr/include/gtk-3.0/;/usr/include/pango-1.0/;/usr/include/cairo/;
/usr/include/gdk-pixbuf-2.0/;/usr/include/atk-1.0/
)
Here is some part of the code:
GError *gError = NULL;
DBusGConnection *dBusGConnection = dbus_g_bus_get(DBUS_BUS_SESSION,gError);
DBusGProxy *dBusGProxy = dbus_g_proxy_new_for_name(dBusGConnection,AUDACIOUS_DBUS_SERVICE,AUDACIOUS_DBUS_PATH,AUDACIOUS_DBUS_INTERFACE);
**audacious_remote_get_main_volume(dBusGProxy);**
but when i try to build the project it returns this error:
/usr/bin/ld: CMakeFiles/untitled.dir/main.c.o: en la función `main':
`main.c:(.text.startup+0x9): referencia a `dbus_g_bus_get' sin definir
/usr/bin/ld: main.c:(.text.startup+0x22): referencia a `dbus_g_proxy_new_for_name' sin definir
/usr/bin/ld: main.c:(.text.startup+0x2a): referencia a `audacious_remote_get_main_volume' sin definir
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/untitled.dir/build.make:84: untitled] Error 1
make[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/untitled.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/untitled.dir/rule] Error 2
make: *** [Makefile:118: untitled] Error 2
I've tried all examples on the internet to try to make it work and nothing. I'm totally new in this world of C/C++ I come from Java and there is no need of doing these sort of things.
Please any help would be appreciated.