how to configure bluetooth on linux with Qt
-
wrote on 20 Jan 2019, 02:12 last edited by aha_1980
Hello
I am trying to cross compile Qt on linux for raspberry pi, but when i installed it and tried the bluetooth example
I got an error with "Dummy bluetooth", when i tried to configure again, i see bluez noQt Bluetooth:
BlueZ .................................. no
BlueZ Low Energy ....................... no
Linux Crypto API ....................... no
WinRT Bluetooth API (desktop & UWP) .... noI tried installing many things including bluez and read this post configuration of bluetooth and gps module but it still did not help.
I would appreciate if somebody helps me to track the missing package
regards,Sherif
Update 1: After tracking with -v, the sysroot does not have bluetooth.h file and i don't find it on the pi.
-
wrote on 20 Jan 2019, 02:48 last edited by SherifOmran
I found the solution to the header file issue:
on the raspberry pi:
sudo apt-get install libbluetooth-dev
then copy the files from the raspberry pi (see cross compile tutorials) to the sysroot folder. This will copy the necessary header file
using
rsync -avz pi@raspberrypi.local:/usr/include sysroot/usrThe next issue i have is:
/opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lbluetooth
I could solve this issue also using sudo apt-get install bluetooth on the raspberry pi and then repeated the rsync step
-
Hi,
This technique is valid for all the dependencies you might require for you application that are not provided with your cross-compiler.
i.e. ->
- get the list of Qt dependencies for the features you need
- install them on your RPi
- sync the sysroot
If your application requires other libraries (for example zmq, boost, etc.) , the technique is the same. That way you also ensure that you are linking to libraries that are compatible with your target.
-
wrote on 20 Jan 2019, 11:51 last edited by SherifOmran
I am trying to include the geolocation and installed gypsy on the pi but i get this while cross compile. On the pi i have libpcre3 and -dev and they were resynced and file pcre.h exists in the sysroot, should i change its name simply or what should i do
> arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/opt/qt5pi/sysroot --sysroot=/opt/qt5pi/sysroot -O2 -std=gnu++11 -w -fPIC -I. -I/opt/qt5pi/qt-everywhere-src-5.10.1/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o main.o main.cpp > main.cpp:3:19: fatal error: pcre2.h: No such file or directory > #include <pcre2.h> > ^ > compilation terminated. I got also the following and now tried with static library
#define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
^
/opt/qt5pi/qt-everywhere-src-5.10.1/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:86:36: note: in ```
expansion of macro ‘Q_STATIC_ASSERT_X’
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " FILE " not available.")
^
/opt/qt5pi/qt-everywhere-src-5.10.1/qtbase/include/QtCore/../../src/corelib/plugin/qlibrary.h:45:1: note: in expansion of macro ‘QT_REQUIRE_CONFIG’
QT_REQUIRE_CONFIG(library);
^
Makefile:27955: recipe for target '.obj/qsslsocket_opensslpre11.o' failed -
I am trying to include the geolocation and installed gypsy on the pi but i get this while cross compile. On the pi i have libpcre3 and -dev and they were resynced and file pcre.h exists in the sysroot, should i change its name simply or what should i do
> arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/opt/qt5pi/sysroot --sysroot=/opt/qt5pi/sysroot -O2 -std=gnu++11 -w -fPIC -I. -I/opt/qt5pi/qt-everywhere-src-5.10.1/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o main.o main.cpp > main.cpp:3:19: fatal error: pcre2.h: No such file or directory > #include <pcre2.h> > ^ > compilation terminated. I got also the following and now tried with static library
#define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
^
/opt/qt5pi/qt-everywhere-src-5.10.1/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:86:36: note: in ```
expansion of macro ‘Q_STATIC_ASSERT_X’
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " FILE " not available.")
^
/opt/qt5pi/qt-everywhere-src-5.10.1/qtbase/include/QtCore/../../src/corelib/plugin/qlibrary.h:45:1: note: in expansion of macro ‘QT_REQUIRE_CONFIG’
QT_REQUIRE_CONFIG(library);
^
Makefile:27955: recipe for target '.obj/qsslsocket_opensslpre11.o' failed@SherifOmran In which directory inside the sysroot is pcre2.h located?
-
wrote on 22 Jan 2019, 09:33 last edited by
i could solve this issue by using a fresh installation of the raspberry pi image and libraries
1/6