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. :-1: error: Unknown module(s) in QT: bluetooth; When trying to play around with the bluetooth functionallity of qt
QtWS25 Last Chance

:-1: error: Unknown module(s) in QT: bluetooth; When trying to play around with the bluetooth functionallity of qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 6 Posters 2.4k Views
  • 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.
  • V Offline
    V Offline
    ViniDalvino
    wrote on last edited by ViniDalvino
    #1

    I was trying to play around with QT bluetooth features however it gave me
    :-1: error: Unknown module(s) in QT: bluetooth;
    when trying to compile my code. I use windows 10 wiith msvc. Here is my code:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QtBluetooth/QBluetoothDeviceInfo>
    #include <QtBluetooth/QBluetoothAddress>
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    
    void MainWindow::on_DispHeadphoneInfo_clicked()
    {
        QBluetoothAddress headphoneAdrr("38:18:4C:02:F6:79");
    //    QBluetoothDeviceInfo headphoneInfo(*headphoneAdrr, "Sony WH-Ch700N", )
    }
    
    

    Here is my qmake file:

    QT       += core gui
    QT       += bluetooth;
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        mainwindow.cpp
    
    HEADERS += \
        mainwindow.h
    
    FORMS += \
        mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • V ViniDalvino

      I was trying to play around with QT bluetooth features however it gave me
      :-1: error: Unknown module(s) in QT: bluetooth;
      when trying to compile my code. I use windows 10 wiith msvc. Here is my code:

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      #include <QtBluetooth/QBluetoothDeviceInfo>
      #include <QtBluetooth/QBluetoothAddress>
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
          , ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      
      void MainWindow::on_DispHeadphoneInfo_clicked()
      {
          QBluetoothAddress headphoneAdrr("38:18:4C:02:F6:79");
      //    QBluetoothDeviceInfo headphoneInfo(*headphoneAdrr, "Sony WH-Ch700N", )
      }
      
      

      Here is my qmake file:

      QT       += core gui
      QT       += bluetooth;
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++11
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
          main.cpp \
          mainwindow.cpp
      
      HEADERS += \
          mainwindow.h
      
      FORMS += \
          mainwindow.ui
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @ViniDalvino You did not mention which Qt version you're using and how you installed it.

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

      1 Reply Last reply
      0
      • V ViniDalvino

        I was trying to play around with QT bluetooth features however it gave me
        :-1: error: Unknown module(s) in QT: bluetooth;
        when trying to compile my code. I use windows 10 wiith msvc. Here is my code:

        #include "mainwindow.h"
        #include "ui_mainwindow.h"
        #include <QtBluetooth/QBluetoothDeviceInfo>
        #include <QtBluetooth/QBluetoothAddress>
        
        MainWindow::MainWindow(QWidget *parent)
            : QMainWindow(parent)
            , ui(new Ui::MainWindow)
        {
            ui->setupUi(this);
        }
        
        MainWindow::~MainWindow()
        {
            delete ui;
        }
        
        
        void MainWindow::on_DispHeadphoneInfo_clicked()
        {
            QBluetoothAddress headphoneAdrr("38:18:4C:02:F6:79");
        //    QBluetoothDeviceInfo headphoneInfo(*headphoneAdrr, "Sony WH-Ch700N", )
        }
        
        

        Here is my qmake file:

        QT       += core gui
        QT       += bluetooth;
        
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
        
        CONFIG += c++11
        
        # You can make your code fail to compile if it uses deprecated APIs.
        # In order to do so, uncomment the following line.
        #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
        
        SOURCES += \
            main.cpp \
            mainwindow.cpp
        
        HEADERS += \
            mainwindow.h
        
        FORMS += \
            mainwindow.ui
        
        # Default rules for deployment.
        qnx: target.path = /tmp/$${TARGET}/bin
        else: unix:!android: target.path = /opt/$${TARGET}/bin
        !isEmpty(target.path): INSTALLS += target
        
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @ViniDalvino said in :-1: error: Unknown module(s) in QT: bluetooth; When trying to play around with the bluetooth functionallity of qt:

        QT += bluetooth;

        I Don't know how qmake handles semicolons, I would imagine not well, remove it


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        A 1 Reply Last reply
        4
        • J.HilkJ J.Hilk

          @ViniDalvino said in :-1: error: Unknown module(s) in QT: bluetooth; When trying to play around with the bluetooth functionallity of qt:

          QT += bluetooth;

          I Don't know how qmake handles semicolons, I would imagine not well, remove it

          A Offline
          A Offline
          Aayushi
          wrote on last edited by
          #4

          @J-Hilk Hey, I have a similar problem. Removing the ' ; ' isn't helping. Can you please suggest an alternative solution?

          Christian EhrlicherC 1 Reply Last reply
          0
          • A Aayushi

            @J-Hilk Hey, I have a similar problem. Removing the ' ; ' isn't helping. Can you please suggest an alternative solution?

            Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Aayushi Even for you it's relevant to answer the questions @jsulm asked. What Qt version, how id you install it, ...

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            A 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Aayushi Even for you it's relevant to answer the questions @jsulm asked. What Qt version, how id you install it, ...

              A Offline
              A Offline
              Aayushi
              wrote on last edited by Aayushi
              #6

              @Christian-Ehrlicher Hey, I have installed QT 6.1.0. from this site: https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34|074ddad0-fdef-4e53-8aa8-5e8a876d6ab4 . The downloaded file was named: qt-unified-windows-x86-4.0.1-1-online.
              Also, I am using Windows 10 with MinGW 64 bit compiler.

              JKSHJ 1 Reply Last reply
              0
              • A Aayushi

                @Christian-Ehrlicher Hey, I have installed QT 6.1.0. from this site: https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34|074ddad0-fdef-4e53-8aa8-5e8a876d6ab4 . The downloaded file was named: qt-unified-windows-x86-4.0.1-1-online.
                Also, I am using Windows 10 with MinGW 64 bit compiler.

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by JKSH
                #7

                @Aayushi said in :-1: error: Unknown module(s) in QT: bluetooth; When trying to play around with the bluetooth functionallity of qt:

                Hey, I have installed QT 6.1.0

                Bluetooth is not yet supported in Qt 6. See https://www.qt.io/blog/add-on-support-in-qt-6.0-and-beyond

                Install Qt 5.15.2 to use the Qt Bluetooth module.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                A 1 Reply Last reply
                2
                • JKSHJ JKSH

                  @Aayushi said in :-1: error: Unknown module(s) in QT: bluetooth; When trying to play around with the bluetooth functionallity of qt:

                  Hey, I have installed QT 6.1.0

                  Bluetooth is not yet supported in Qt 6. See https://www.qt.io/blog/add-on-support-in-qt-6.0-and-beyond

                  Install Qt 5.15.2 to use the Qt Bluetooth module.

                  A Offline
                  A Offline
                  Aayushi
                  wrote on last edited by
                  #8

                  @JKSH Thank you, I'll try installing it.

                  1 Reply Last reply
                  0

                  • Login

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