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. error: Unknown module(s) in QT: mqtt
Qt 6.11 is out! See what's new in the release blog

error: Unknown module(s) in QT: mqtt

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 1.8k 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.
  • J Offline
    J Offline
    Jo Jo
    wrote on last edited by Jo Jo
    #1

    I'm trying to use the mqtt module, but when I write QT += mqtt in the .pro file, I get the error: error: Unknown module(s) in QT: mqtt.

    I searched for the mqtt module in the Maintenance Tool, but it's not listed. Isn't mqtt a standard module included with Qt? What's the problem?

    I'm using Qt 6.10.1 with C++. Compiling on Windows using qmake/msvc

    jsulmJ 1 Reply Last reply
    0
    • J Offline
      J Offline
      Jo Jo
      wrote on last edited by Jo Jo
      #10

      Here is solution:

      1. create mqtt directory
      2. run "git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1" in this directory
      3. open qtmqtt directory and create build folder in it
      4. open "X64 native tools command prompt for VS 2022" in build folder and run following commands:

      To build Release version:
      cmake -S .. -B build -G "Ninja" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
      cmake --build build --config Release
      cmake --install build

      To build Debug version:
      cmake -S .. -B build -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
      cmake --build build --config Debug
      cmake --install build --config Debug

      1 Reply Last reply
      0
      • J Jo Jo

        I'm trying to use the mqtt module, but when I write QT += mqtt in the .pro file, I get the error: error: Unknown module(s) in QT: mqtt.

        I searched for the mqtt module in the Maintenance Tool, but it's not listed. Isn't mqtt a standard module included with Qt? What's the problem?

        I'm using Qt 6.10.1 with C++. Compiling on Windows using qmake/msvc

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @Jo-Jo I'm not sure, but I think mqtt is only available as binary for commercial users. You can still build it from source though.

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

        1 Reply Last reply
        2
        • J Offline
          J Offline
          Jo Jo
          wrote on last edited by
          #3

          @jsulm It also available under GPL https://doc.qt.io/qt-6/qtmqtt-index.html

          I compiled the project using the following commands:
          git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1
          and then from build directory:
          cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
          cmake --build build --config Release
          cmake --install build

          But this builds the mqtt module for release. I tried building it for debug, but it still only builds for release. How do I build it for debug version?

          jsulmJ JoeCFDJ 2 Replies Last reply
          0
          • J Jo Jo

            @jsulm It also available under GPL https://doc.qt.io/qt-6/qtmqtt-index.html

            I compiled the project using the following commands:
            git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1
            and then from build directory:
            cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
            cmake --build build --config Release
            cmake --install build

            But this builds the mqtt module for release. I tried building it for debug, but it still only builds for release. How do I build it for debug version?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Jo-Jo said in error: Unknown module(s) in QT: mqtt:

            I tried building it for debug

            In a fresh build folder?

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

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jo Jo
              wrote on last edited by
              #5

              @jsulm Yes, In a fresh build folder

              jsulmJ 1 Reply Last reply
              0
              • J Jo Jo

                @jsulm Yes, In a fresh build folder

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @Jo-Jo How exactly do you build for debug?

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

                J 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @Jo-Jo How exactly do you build for debug?

                  J Offline
                  J Offline
                  Jo Jo
                  wrote on last edited by
                  #7

                  @jsulm said in error: Unknown module(s) in QT: mqtt:

                  @Jo-Jo How exactly do you build for debug?

                  cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
                  cmake --build build --config Debug
                  cmake --install build

                  and after cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"

                  I see following output:
                  ...
                  -- Setting build type to 'Release' as none was specified.

                  It does not recognize debug mode

                  SGaistS 1 Reply Last reply
                  0
                  • J Jo Jo

                    @jsulm It also available under GPL https://doc.qt.io/qt-6/qtmqtt-index.html

                    I compiled the project using the following commands:
                    git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1
                    and then from build directory:
                    cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
                    cmake --build build --config Release
                    cmake --install build

                    But this builds the mqtt module for release. I tried building it for debug, but it still only builds for release. How do I build it for debug version?

                    JoeCFDJ Offline
                    JoeCFDJ Offline
                    JoeCFD
                    wrote on last edited by
                    #8

                    @Jo-Jo I guess you built only Qt module for using mqtt.
                    Mqtt needs to be installed separately. Check the following out:
                    https://mosquitto.org/download/

                    1 Reply Last reply
                    0
                    • J Jo Jo

                      @jsulm said in error: Unknown module(s) in QT: mqtt:

                      @Jo-Jo How exactly do you build for debug?

                      cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
                      cmake --build build --config Debug
                      cmake --install build

                      and after cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"

                      I see following output:
                      ...
                      -- Setting build type to 'Release' as none was specified.

                      It does not recognize debug mode

                      SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by SGaist
                      #9

                      @Jo-Jo Hi,

                      If you have ccmake you can check visually what is configured to find out what is happening.

                      @JoeCFD said in error: Unknown module(s) in QT: mqtt:

                      @Jo-Jo I guess you built only Qt module for using mqtt.
                      Mqtt needs to be installed separately. Check the following out:
                      https://mosquitto.org/download/

                      It's unrelated to the problem at hand. @Jo-Jo wants to use/build the QtMQTT module.

                      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
                      0
                      • J Offline
                        J Offline
                        Jo Jo
                        wrote on last edited by Jo Jo
                        #10

                        Here is solution:

                        1. create mqtt directory
                        2. run "git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1" in this directory
                        3. open qtmqtt directory and create build folder in it
                        4. open "X64 native tools command prompt for VS 2022" in build folder and run following commands:

                        To build Release version:
                        cmake -S .. -B build -G "Ninja" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
                        cmake --build build --config Release
                        cmake --install build

                        To build Debug version:
                        cmake -S .. -B build -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
                        cmake --build build --config Debug
                        cmake --install build --config Debug

                        1 Reply Last reply
                        0
                        • J Jo Jo has marked this topic as solved on

                        • Login

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