Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Can not configure qt with bluetooth



  • I want to build QT 5.12 with Bluetooth for arm by follow configure :

     ./configure \
    -v \
    -prefix /opt/Qte-5.12.0 \
    -opensource \
    -make libs \
    -xplatform linux-arm-gnueabi-g++ \
    -optimized-qmake \
    -pch \
    -linuxfb \
    -qt-libpng \
    -qt-libjpeg \
    -tslib \
    -qt-zlib \
    -no-opengl \
    -no-sse2 \
    -no-openssl \
    -no-cups \
    -no-glib \
    -no-iconv \
    -nomake examples \
    -nomake tools \
    -confirm-license \
    -I/opt/tslib/include \
    -L/opt/tslib/lib
    

    but I get configure summary as follows:

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

    I had installed libBluetooth by apt-get, but can not find bluez also.
    And my cross compile Qt application run with logs:

    qt.bluetooth: Dummy backend running. Qt Bluetooth module is non-functional.
    

    I use arm-buildroot-linux-uclibcgnueabihf for cross compile. I new in QT, thank you very much for your reply.


  • Lifetime Qt Champion

    @Fang said in Can not configure qt with bluetooth:

    I had installed libBluetooth by apt-get, but can not find bluez also

    Did you install it into your sysroot? Installing these packages on the host will not help as you're cross compiling.
    Also, you need -dev packages (like libbluetooth-dev).



  • @jsulm Thanks.
    In my sysroot has

    libbluetooth.so
    libbluetooth.so.3
    libbluetooth.so.3.13.0
    

    Does it mean libBluetooth-dev packages were installed?



  • @Fang said in Can not configure qt with bluetooth:

    In configure, I add the sysroot directory:

    ./configure
    -v
    -prefix /opt/Qte-5.12.0
    -opensource
    -make libs
    -xplatform linux-arm-gnueabi-g++
    -optimized-qmake
    -pch
    -linuxfb
    -qt-libpng
    -qt-libjpeg
    -tslib
    -qt-zlib
    -no-opengl
    -no-sse2
    -no-openssl
    -no-cups
    -no-glib
    -no-iconv
    -nomake examples
    -nomake tools
    -confirm-license
    -sysroot /usr/local/bin/armv7-eabihf-uclibc-stable-2018.02-1/arm-buildroot-linux-uclibcgnueabihf/sysroot
    -I/opt/tslib/include
    -L/opt/tslib/lib

    But still can not find Bluetooth:

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

  • Lifetime Qt Champion

    @Fang said in Can not configure qt with bluetooth:

    Does it mean libBluetooth-dev packages were installed?

    No, dev packages contain header files needed to compile applications using these libraries.
    If you add -v parameter to configure you will get more information about what exactly is missing.



  • Hi,jsulm.I have compiled libBluetooth-dev in Linux, but how can I contain it to QT? The ./configure need to change?


  • Lifetime Qt Champion

    @fang said in Can not configure qt with bluetooth:

    compiled libBluetooth-dev

    Do you mean you installed the dev package for Bluetooth?
    If so then run configure from Qt again and check the output.



  • Possible solutions could be:

    1)implement a class that wrap all the set up and stuff to perform a discovery
    2)make discoveryAgent a class member
    A faster way to try it out is a Qt console application



  • Thanks,jsulm.Thanks Jack.
    I cross compiling libBluetooth packages to specified path,and it contain:
    0_1565147418157_27c444a0-32a7-49d2-ba6c-7ee18a1c5fdb-image.png

    but I don't know how to associated with QT,doest it configure with my old:

    ./configure 
    -v 
    -prefix /opt/Qte-5.12.0 
    -opensource 
    -make libs 
    -xplatform linux-arm-gnueabi-g++ 
    -optimized-qmake 
    -pch 
    -linuxfb 
    -qt-libpng 
    -qt-libjpeg 
    -tslib 
    -qt-zlib 
    -no-opengl 
    -no-sse2 
    -no-openssl 
    -no-cups 
    -no-glib 
    -no-iconv 
    -nomake examples 
    -nomake tools 
    -confirm-license 
    -sysroot /usr/local/bin/armv7-eabihf-uclibc-stable-2018.02-1/arm-buildroot-linux-uclibcgnueabihf/sysroot 
    -I/opt/tslib/include 
    -L/opt/tslib/lib
    

    but it cannot contain Bluetooth also:

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

    how can I do ?


  • Lifetime Qt Champion

    @fang You need to have the Bluetooth headers and libs in your sysroot if you cross compile. Or you compile it using you cross compalation tool chain and pass include and lib path to your configure call (like you do for tslib).
    I see that you use this as sysroot: /usr/local/bin/armv7-eabihf-uclibc-stable-2018.02-1/arm-buildroot-linux-uclibcgnueabihf/sysroot
    Do you have the Bluetooth stuff there?
    "I cross compiling libBluetooth packages to specified path,and it contain:" - what path do you mean? Your sysroot?



  • @jsulm I can contain Bluetooth in QT, I copy the bluetooth stuff to my sysroot, and specified Bluetooth path in configure and the relevant section of output of ./configrue now:

    Qt Bluetooth:
      BlueZ .................................. yes
      BlueZ Low Energy ....................... yes
      Linux Crypto API ....................... yes
    
    

    Thank you very much for your help!


Log in to reply