Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to configure bluetooth on linux with Qt
Forum Updated to NodeBB v4.3 + New Features

how to configure bluetooth on linux with Qt

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SherifOmran
    wrote on 20 Jan 2019, 02:12 last edited by aha_1980
    #1

    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 no

    Qt Bluetooth:
    BlueZ .................................. no
    BlueZ Low Energy ....................... no
    Linux Crypto API ....................... no
    WinRT Bluetooth API (desktop & UWP) .... no

    I 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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SherifOmran
      wrote on 20 Jan 2019, 02:48 last edited by SherifOmran
      #2

      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/usr

      The 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

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 20 Jan 2019, 08:11 last edited by
        #3

        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. ->

        1. get the list of Qt dependencies for the features you need
        2. install them on your RPi
        3. 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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • S Offline
          S Offline
          SherifOmran
          wrote on 20 Jan 2019, 11:51 last edited by SherifOmran
          #4

          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

          J 1 Reply Last reply 21 Jan 2019, 06:12
          0
          • S SherifOmran
            20 Jan 2019, 11:51

            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

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 21 Jan 2019, 06:12 last edited by
            #5

            @SherifOmran In which directory inside the sysroot is pcre2.h located?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SherifOmran
              wrote on 22 Jan 2019, 09:33 last edited by
              #6

              i could solve this issue by using a fresh installation of the raspberry pi image and libraries

              1 Reply Last reply
              0

              1/6

              20 Jan 2019, 02:12

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved