Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Installing MQTT module

    General and Desktop
    mqtt c++ widget ubuntu
    3
    11
    499
    Loading More Posts
    • 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.
    • D
      Dean21 last edited by

      Hi, so I have been trying all day to get the the QtMqtt library/module to install/work. I have tried all the guides I could find on google and still no luck.

      I have cloned the repository from https://code.qt.io/cgit/qt/qtmqtt.git/ using

      command git clone -b 6.4.2 https://code.qt.io/cgit/qt/qtmqtt.git/
      

      I then tried using the qmake -query QT_INSTALL_LIB command which comes back as unknown
      I did have this at one point displaying the right path but I deleted what I had cloned and started again and now i get the unknown from the command.

      I then cd into the folder where I cloned it to and navigate to where the mqtt.pro file is (inside examples->mqtt) (also most guides say this file should be called qtmqtt.pro) but mine isnt.

      Then when I run am in the folder where the mqtt.pro file is I run commands

      qmake
      make
      make install 
      

      (tried all with sudo)

      but when I run make and make install I get this error

      Project ERROR: Unknown module(s) in QT: mqtt
      

      also when inside the a qt project I want to use the library in I include QT += mqtt in the .pro file, but I get the error

      Unknown module(s) in QT: mqtt
      

      I have also tried the library from https://github.com/emqx/qmqtt with no luck/similar results.

      Any help with this would be amazing, I have no idea what I am doing wrong and am baffled that it is this hard/confusing to install a library, or I am just being stupid.

      FYI: using ubuntu, qmake and am creating widget applications

      Thanks in advance,
      Dean

      1 Reply Last reply Reply Quote 0
      • JoeCFD
        JoeCFD last edited by JoeCFD

        where is your mqtt lib installed? If you add it in pro like QT += mqtt, mqtt lib should be in the libs dir of qt you use. Check out if it is the case. If not, purge mqtt you installed and reinstall it at the right place.

        D 1 Reply Last reply Reply Quote 0
        • D
          Dean21 @JoeCFD last edited by

          @JoeCFD to find out if it is in the libs dir of qt is that the command qmake -query QT_INSTALL_LIB. If it is then when I ran it i either got unknown or a directory name but inside that directory there wasnt any mqtt library files

          JoeCFD 1 Reply Last reply Reply Quote 0
          • JoeCFD
            JoeCFD @Dean21 last edited by

            @Dean21 how did you install Qt?
            show the output here
            which qmake
            and
            qmake --version

            D 1 Reply Last reply Reply Quote 0
            • D
              Dean21 @JoeCFD last edited by

              @JoeCFD what do you mean how did i install qt, do u mean how i installed qt creator? I did that by going to the website and downloading the open source linux file, then did the setup in the program, and it downloaded everything.
              Not sure which qmake version i am not with my computer but can check tomorrow.

              JoeCFD 1 Reply Last reply Reply Quote 0
              • JoeCFD
                JoeCFD @Dean21 last edited by JoeCFD

                @Dean21 that means you may not have qt 6.4.2 yet.
                Install Qt 6.4.2. QtMqtt Is only one component of Qt package.
                which qmake and qmake --version are two Linux commands to run.

                D 1 Reply Last reply Reply Quote 0
                • D
                  Dean21 @JoeCFD last edited by

                  @JoeCFD Hi joe I can confirm that I do have version 6.4.2 of Qt, as I can see the folder name 6.4.2 inside the Qt directory

                  JoeCFD 2 Replies Last reply Reply Quote 0
                  • JoeCFD
                    JoeCFD @Dean21 last edited by

                    @Dean21

                    show the output here
                    which qmake
                    and
                    qmake --version

                    1 Reply Last reply Reply Quote 0
                    • JoeCFD
                      JoeCFD @Dean21 last edited by

                      @Dean21 If you see qt6.4.2, check where qt mqtt lib is installed.

                      D 1 Reply Last reply Reply Quote 0
                      • D
                        Dean21 @JoeCFD last edited by

                        @JoeCFD by qt mqtt lib what do you mean, like the qtmqtt folder that I git cloned, if so then I have tried having it where I downloaded qt, where it gets put nominally when using git clone, and also inside the Src folder in side the 6.4.2 folder

                        jsulm 1 Reply Last reply Reply Quote 0
                        • jsulm
                          jsulm Lifetime Qt Champion @Dean21 last edited by

                          @Dean21 @JoeCFD asked where the mqtt libs you built are stored, not where the code is...

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

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post