BluetoothBLEClient
BluetoothBLEClient copied to clipboard
Compilation issue
Hello,
While running make Makefile I get the following error:
gcc -c -g -Ibluez-5.50 -Ibluez-5.50/gdbus -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -o obj/ble.o ble.c ble.c:39:33: fatal error: src/shared/mainloop.h: No such file or directory #include "src/shared/mainloop.h" ^
I don't find any file called mainloop.h in any bluez related directories. Help would be appreciated.
I resolved this error by following the directions at the very beginning of the Setup section:
wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.49.tar.xz
tar xvf bluez-5.49.tar.xz
After that I got the following error:
% make all
gcc -c -g -Ibluez-5.49 -Ibluez-5.49/gdbus -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -o obj/ble.o ble.c
In file included from bluez-5.49/gdbus/gdbus.h:31,
from ble.c:40:
/usr/include/dbus-1.0/dbus/dbus.h:29:10: fatal error: dbus/dbus-arch-deps.h: No such file or directory
29 | #include <dbus/dbus-arch-deps.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:80: obj/ble.o] Error 1
Which I resolved by running as:
% make all SYS_LIB=/usr/lib/x86_64-linux-gnu