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. How can i add module mqtt to QT?

How can i add module mqtt to QT?

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 8 Posters 22.2k 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.
  • A Offline
    A Offline
    alphaT
    wrote on 31 Jan 2018, 10:03 last edited by
    #1

    After I do all command

    git clone https://github.com/emqtt/qmqtt.git
    cd qmqtt
    mkdir build
    cd build
    qmake -r ..
    make
    sudo make install

    => then i can complie the example code in source I download from git but when I create new project, in .pro I add line "QT += mqtt" then QT show me "Project ERROR: Unknown module(s) in QT: mqtt"

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 31 Jan 2018, 10:17 last edited by
      #2

      Hi and welcome to devnet,

      This module is not an official Qt module so you should contact the authors of it.

      As for the official QtMqtt module, it is located at http://code.qt.io/cgit/qt/qtmqtt.git/

      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
      1
      • A Offline
        A Offline
        alphaT
        wrote on 31 Jan 2018, 14:56 last edited by
        #3

        Thank you for reply my question.
        Is there any way to using it in QT ? because I see it has been added with the other QT module.
        0_1517408493013_4a14e4c9-5c03-4afe-a09a-c12ecfd1da88-image.png

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 31 Jan 2018, 17:52 last edited by
          #4

          Hi
          is github.com/emqtt a true Qt module ?
          Looks to me as just an normal c++ lib/so/dll ?

          To use such lib, one would just tell Creator via the .pro file
          http://doc.qt.io/qt-5/third-party-libraries.html
          Key points being

          INCLUDEPATH += xxxxxx/include
          LIBS += -L"xxxx/lib" -lqtmqtt

          The page do not seems to call it a module but I could be wrong.

          1 Reply Last reply
          2
          • J Offline
            J Offline
            Jorgen
            wrote on 31 Jan 2018, 19:14 last edited by
            #5

            You should load it or bind it to your project like @mrjj said.

            btw. qtmqtt repository: I had some issues on building. After fixing that it worked - but is really in a early state. There is no support for proxy - so if you are behind a company proxy, there is no way to use the official MQTT client. Also the broker is just in work and not working yet.
            Hope they will continue work on here, because I want to use a official module...

            1 Reply Last reply
            1
            • A Offline
              A Offline
              alphaT
              wrote on 1 Feb 2018, 08:28 last edited by
              #6

              @mrjj
              yep, it's all C++ file but how can I organize the folder in QT like that?
              0_1517472936740_1a4a2b92-9854-4394-acd3-6404e3817240-image.png
              I search a lot, but I have only one answer in stackoverflow .
              0_1517473469280_161e25a0-f6db-46aa-a1b4-247cf435d7fb-image.png

              J 1 Reply Last reply 1 Feb 2018, 08:37
              0
              • A alphaT
                1 Feb 2018, 08:28

                @mrjj
                yep, it's all C++ file but how can I organize the folder in QT like that?
                0_1517472936740_1a4a2b92-9854-4394-acd3-6404e3817240-image.png
                I search a lot, but I have only one answer in stackoverflow .
                0_1517473469280_161e25a0-f6db-46aa-a1b4-247cf435d7fb-image.png

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 1 Feb 2018, 08:37 last edited by
                #7

                @alphaT Just create all these directories put the files there and edit your pro file to point to the files. Like:

                SOURCES += src/main.cpp
                

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

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  alphaT
                  wrote on 1 Feb 2018, 09:08 last edited by
                  #8

                  thank for fast reply @jsulm , where can I create these directories?
                  I try to Add Existing Directory, but it doesn't seem to work.
                  0_1517475107765_30e195c7-e5c7-4604-8880-2b9983432e20-image.png

                  J 1 Reply Last reply 1 Feb 2018, 09:12
                  0
                  • A alphaT
                    1 Feb 2018, 09:08

                    thank for fast reply @jsulm , where can I create these directories?
                    I try to Add Existing Directory, but it doesn't seem to work.
                    0_1517475107765_30e195c7-e5c7-4604-8880-2b9983432e20-image.png

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 1 Feb 2018, 09:12 last edited by
                    #9

                    @alphaT You can do it with any file manager on in a terminal

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

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      alphaT
                      wrote on 2 Feb 2018, 16:54 last edited by
                      #10

                      Thank all of you for your help.

                      INCLUDEPATH += ~/qmqtt/src/mqtt
                      LIBS += -L"~/qmqtt/src/mqtt" -lqmqtt

                      I just add two line to .pro file like you say above, and it works.

                      1 Reply Last reply
                      0
                      • lorn.potterL Offline
                        lorn.potterL Offline
                        lorn.potter
                        wrote on 2 Feb 2018, 19:15 last edited by
                        #11

                        If you want the Qt Mqtt module that Qt Company is developing, that is here:
                        http://code.qt.io/cgit/qt/qtmqtt.git/

                        You need to clone: git://code.qt.io/qt/qtmqtt.git

                        This does install a module called 'mqtt'

                        Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                        Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                        A J 2 Replies Last reply 3 Feb 2018, 05:06
                        0
                        • lorn.potterL lorn.potter
                          2 Feb 2018, 19:15

                          If you want the Qt Mqtt module that Qt Company is developing, that is here:
                          http://code.qt.io/cgit/qt/qtmqtt.git/

                          You need to clone: git://code.qt.io/qt/qtmqtt.git

                          This does install a module called 'mqtt'

                          A Offline
                          A Offline
                          alphaT
                          wrote on 3 Feb 2018, 05:06 last edited by
                          #12

                          @lorn.potter did you complie that source?
                          I try to complie it, but it's report error...

                          lorn.potterL 1 Reply Last reply 3 Feb 2018, 07:07
                          0
                          • A alphaT
                            3 Feb 2018, 05:06

                            @lorn.potter did you complie that source?
                            I try to complie it, but it's report error...

                            lorn.potterL Offline
                            lorn.potterL Offline
                            lorn.potter
                            wrote on 3 Feb 2018, 07:07 last edited by lorn.potter 2 Mar 2018, 08:35
                            #13

                            @alphaT Yes, I do compile that. I just did on Mac, with Qt 5.10

                            Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                            Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                            A 2 Replies Last reply 3 Feb 2018, 14:29
                            0
                            • lorn.potterL lorn.potter
                              3 Feb 2018, 07:07

                              @alphaT Yes, I do compile that. I just did on Mac, with Qt 5.10

                              A Offline
                              A Offline
                              alphaT
                              wrote on 3 Feb 2018, 14:29 last edited by
                              #14

                              @lorn.potter 5.10 is the latest version?
                              I am using an older version, let me try QT 5.10.

                              1 Reply Last reply
                              0
                              • lorn.potterL lorn.potter
                                3 Feb 2018, 07:07

                                @alphaT Yes, I do compile that. I just did on Mac, with Qt 5.10

                                A Offline
                                A Offline
                                alphaT
                                wrote on 4 Feb 2018, 04:08 last edited by
                                #15

                                @lorn.potter ops, still error too.
                                0_1517717253481_e830e2f7-079e-4320-a44b-99cda1e81352-image.png

                                J 1 Reply Last reply 5 Feb 2018, 06:58
                                0
                                • A alphaT
                                  4 Feb 2018, 04:08

                                  @lorn.potter ops, still error too.
                                  0_1517717253481_e830e2f7-079e-4320-a44b-99cda1e81352-image.png

                                  J Offline
                                  J Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on 5 Feb 2018, 06:58 last edited by
                                  #16

                                  @alphaT It looks like you're building with Qt which is delivered by your Linux distribution (/usr/include/qt5).
                                  I guess you simply called qmake from command line, right?
                                  You should use complete path to qmake from Qt you installed:

                                  ~/Qt/5.10.0/gcc_64/bin/qmake
                                  

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

                                  1 Reply Last reply
                                  2
                                  • A Offline
                                    A Offline
                                    Andarang
                                    wrote on 8 Jun 2020, 11:12 last edited by
                                    #17

                                    It's been a while but I experienced some of the issues described here and a few other forums. Just for whoever stumbles upon this issue, there is a small thing I overlooked when getting the source code from GitHub, namely:

                                    If you clone from the GitHub repo, don't forget to check out a release version!

                                    Current release is v5.15.0, but I was working from the dev branch, which caused a bunch of errors when compiling. After checking out release v5.15.0 everything suddenly worked.

                                    1 Reply Last reply
                                    0
                                    • lorn.potterL lorn.potter
                                      2 Feb 2018, 19:15

                                      If you want the Qt Mqtt module that Qt Company is developing, that is here:
                                      http://code.qt.io/cgit/qt/qtmqtt.git/

                                      You need to clone: git://code.qt.io/qt/qtmqtt.git

                                      This does install a module called 'mqtt'

                                      J Offline
                                      J Offline
                                      Jari Koivuluoma
                                      wrote on 12 May 2021, 13:51 last edited by
                                      #18

                                      @lorn-potter How exactly do I compile this? I am a total newbie on these things. I'm using MSVC 2015 65. I cloned the repo and I opened the terminal in that folder, ran vcvars64.bat and tried qmake but it just gave me the instructions. Should there be a *.pro file in the directory.

                                      J 1 Reply Last reply 14 May 2021, 06:05
                                      0
                                      • J Jari Koivuluoma
                                        12 May 2021, 13:51

                                        @lorn-potter How exactly do I compile this? I am a total newbie on these things. I'm using MSVC 2015 65. I cloned the repo and I opened the terminal in that folder, ran vcvars64.bat and tried qmake but it just gave me the instructions. Should there be a *.pro file in the directory.

                                        J Offline
                                        J Offline
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on 14 May 2021, 06:05 last edited by
                                        #19

                                        @Jari-Koivuluoma Did you checkout Qt5 branch? If you check https://code.qt.io/cgit/qt/qtmqtt.git/tree/?h=5.12 you will see that there is a pro file. I guess you are on master branch, which is Qt6 and based on CMake.

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

                                        1 Reply Last reply
                                        2
                                        • J Offline
                                          J Offline
                                          Jari Koivuluoma
                                          wrote on 24 May 2021, 15:11 last edited by
                                          #20

                                          Thanks, I had to study how to clone a specific branch. I just mistakenly assumed that the cloning link was automatically generated when I changed the branch. From there it went without a hitch.

                                          1 Reply Last reply
                                          2

                                          • Login

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