Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Bluetooth header file error on android
Forum Updated to NodeBB v4.3 + New Features

Bluetooth header file error on android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 3 Posters 3.0k 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.
  • A Offline
    A Offline
    Avtansh Sharma
    wrote on 20 Jun 2017, 11:48 last edited by
    #1

    Hi,

    I made a desktop application using Bluetooth. However I am unable to build it for android
    I think the bluez is not present on Android.
    Can anyone tell me how to install bluez on android

    error: bluetooth/bluetooth.h: No such file or directory
    #include <bluetooth/bluetooth.h>
    ^

    Regards,
    Avtansh Sharma

    J 1 Reply Last reply 20 Jun 2017, 12:15
    0
    • A Avtansh Sharma
      20 Jun 2017, 11:48

      Hi,

      I made a desktop application using Bluetooth. However I am unable to build it for android
      I think the bluez is not present on Android.
      Can anyone tell me how to install bluez on android

      error: bluetooth/bluetooth.h: No such file or directory
      #include <bluetooth/bluetooth.h>
      ^

      Regards,
      Avtansh Sharma

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 Jun 2017, 12:15 last edited by
      #2

      @Avtansh-Sharma It should actually work. Can you show the whole error log?
      Are you using QtBluetooth or bluez directly?

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Avtansh Sharma
        wrote on 20 Jun 2017, 12:34 last edited by
        #3

        I am using BLuez. It builds successfully as desktop application for linux but fails for android

        18:03:30: Running steps for project splinechart...
        18:03:30: Configuration unchanged, skipping qmake step.
        18:03:30: Starting: "/usr/bin/make"
        /home/user/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=/home/user/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/ -O2 -Os -mthumb -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_CHARTS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I../splinechart -I. -I../../../../5.9/android_armv7/include -I../../../../5.9/android_armv7/include/QtCharts -I../../../../5.9/android_armv7/include/QtWidgets -I../../../../5.9/android_armv7/include/QtGui -I../../../../5.9/android_armv7/include/QtSql -I../../../../5.9/android_armv7/include/QtCore -I. -isystem /home/user/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/user/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/user/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/include -I../../../../5.9/android_armv7/mkspecs/android-g++ -o devicedata.o ../splinechart/devicedata.cpp
        ../splinechart/devicedata.cpp:7:33: fatal error: bluetooth/bluetooth.h: No such file or directory
        #include <bluetooth/bluetooth.h>
        ^
        compilation terminated.

        Makefile:1211: recipe for target 'devicedata.o' failed
        make: *** [devicedata.o] Error 1
        18:03:31: The process "/usr/bin/make" exited with code 2.
        Error while building/deploying project splinechart (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.9.0 for Android armv7))
        When executing step "Make"
        18:03:31: Elapsed time: 00:00.

        J 1 Reply Last reply 20 Jun 2017, 12:47
        0
        • A Avtansh Sharma
          20 Jun 2017, 12:34

          I am using BLuez. It builds successfully as desktop application for linux but fails for android

          18:03:30: Running steps for project splinechart...
          18:03:30: Configuration unchanged, skipping qmake step.
          18:03:30: Starting: "/usr/bin/make"
          /home/user/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=/home/user/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/ -O2 -Os -mthumb -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_CHARTS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I../splinechart -I. -I../../../../5.9/android_armv7/include -I../../../../5.9/android_armv7/include/QtCharts -I../../../../5.9/android_armv7/include/QtWidgets -I../../../../5.9/android_armv7/include/QtGui -I../../../../5.9/android_armv7/include/QtSql -I../../../../5.9/android_armv7/include/QtCore -I. -isystem /home/user/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/user/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/user/Android/Sdk/ndk-bundle/platforms/android-16/arch-arm/usr/include -I../../../../5.9/android_armv7/mkspecs/android-g++ -o devicedata.o ../splinechart/devicedata.cpp
          ../splinechart/devicedata.cpp:7:33: fatal error: bluetooth/bluetooth.h: No such file or directory
          #include <bluetooth/bluetooth.h>
          ^
          compilation terminated.

          Makefile:1211: recipe for target 'devicedata.o' failed
          make: *** [devicedata.o] Error 1
          18:03:31: The process "/usr/bin/make" exited with code 2.
          Error while building/deploying project splinechart (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.9.0 for Android armv7))
          When executing step "Make"
          18:03:31: Elapsed time: 00:00.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 20 Jun 2017, 12:47 last edited by
          #4

          @Avtansh-Sharma If you're using bluez then this isn't a Qt issue and you're asking in the wrong forum.
          I don't know whether Android NDK contains bluez.

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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Avtansh Sharma
            wrote on 20 Jun 2017, 13:53 last edited by
            #5

            Hi,

            If i use QTBluetooth then would I require the ndk to have bluetooth libraries or QT framework will take care of it.


            Regards.
            Avtansh Sharma

            J E 2 Replies Last reply 21 Jun 2017, 04:36
            0
            • A Avtansh Sharma
              20 Jun 2017, 13:53

              Hi,

              If i use QTBluetooth then would I require the ndk to have bluetooth libraries or QT framework will take care of it.


              Regards.
              Avtansh Sharma

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 21 Jun 2017, 04:36 last edited by
              #6

              @Avtansh-Sharma NDK contains everything Qt needs, at least it would be new to me that you would need to install something else.

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

              A 1 Reply Last reply 21 Jun 2017, 09:49
              0
              • A Avtansh Sharma
                20 Jun 2017, 13:53

                Hi,

                If i use QTBluetooth then would I require the ndk to have bluetooth libraries or QT framework will take care of it.


                Regards.
                Avtansh Sharma

                E Offline
                E Offline
                ekkescorner
                Qt Champions 2016
                wrote on 21 Jun 2017, 07:57 last edited by
                #7

                @Avtansh-Sharma said in Bluetooth header file error on android:

                Hi,

                If i use QTBluetooth then would I require the ndk to have bluetooth libraries or QT framework will take care of it.

                I only used Bluetooth LE yet and it works great on Android and iOS

                ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                5.15 --> 6.8 https://t1p.de/ekkeChecklist
                QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                A 1 Reply Last reply 21 Jun 2017, 09:50
                0
                • J jsulm
                  21 Jun 2017, 04:36

                  @Avtansh-Sharma NDK contains everything Qt needs, at least it would be new to me that you would need to install something else.

                  A Offline
                  A Offline
                  Avtansh Sharma
                  wrote on 21 Jun 2017, 09:49 last edited by
                  #8

                  @jsulm Google discontinued Bluez and is currently using Droid Bluetooth since the kitkat version

                  1 Reply Last reply
                  0
                  • E ekkescorner
                    21 Jun 2017, 07:57

                    @Avtansh-Sharma said in Bluetooth header file error on android:

                    Hi,

                    If i use QTBluetooth then would I require the ndk to have bluetooth libraries or QT framework will take care of it.

                    I only used Bluetooth LE yet and it works great on Android and iOS

                    A Offline
                    A Offline
                    Avtansh Sharma
                    wrote on 21 Jun 2017, 09:50 last edited by
                    #9

                    @ekkescorner I cannot use Bluetooth Le due to hardware restrictions

                    1 Reply Last reply
                    0

                    1/9

                    20 Jun 2017, 11:48

                    • Login

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