Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMQTT
Qt 6.11 is out! See what's new in the release blog

QMQTT

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 4 Posters 7.2k Views 2 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.
  • M Offline
    M Offline
    MScottM
    wrote on last edited by
    #5

    I guess I knew that was possible to do, but have never looked into it much, as I never have much luck building from source, even on Linux based machines. I can't seem to find a clear instruction on how to do it. Here is what I tried:

    -Downloaded the files from GitHub and extracted them into my Qt installation folder: /Qt/5.2.13/Src/qtmqtt-dev
    -Started a QtMinGW-32 terminal window (MinGW 7.3.0 64-bit) and navigated into the qtmqtt-dev folder
    -tried executing mingw32-make: "***No targets specified and no makefile found"
    -tried executing qmake and it created a few files and ended
    -tried executing mingw32 again (seeing that maybe it had a makefile to use now?) and it actually started doing something, but terminated with this message:

    In file included from qmqttauthenticationproperties.cpp:30:0:
    qmqttauthenticationproperties.h:33:10: fatal error: QtMqtt/qmqttglobal.h: No such file or directory
    #include <QtMqtt/qmqttglobal.h>
    ^~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    mingw32-make[3]: *** [Makefile.Release:570: .obj/release/qmqttauthenticationproperties.o] Error 1
    mingw32-make[3]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-dev/src/mqtt'
    mingw32-make[2]: *** [Makefile:42: release-all] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-dev/src/mqtt'
    mingw32-make[1]: *** [Makefile:43: sub-mqtt-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-dev/src'
    mingw32-make: *** [Makefile:45: sub-src-make_first] Error 2

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #6

      You likely have the code for the dev branch which is Qt 6. Please clone the module properly and checkout the branch that matches your Qt version.

      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
      • M Offline
        M Offline
        MScottM
        wrote on last edited by
        #7

        Hi @SGaist, you were right, of course - I had the dev branch.

        I downloaded the branch for 5.12.3, followed the same steps as above, and had the exact same error. Then I tried the same for the other versions of Qt that I have on my computer: 5.12.2 and 6.0.0 (each in the respective /Src directory), all with the same exact error:

        In file included from qmqttauthenticationproperties.cpp:30:0:
        qmqttauthenticationproperties.h:33:10: fatal error: QtMqtt/qmqttglobal.h: No such file or directory
        #include <QtMqtt/qmqttglobal.h>
        ^~~~~~~~~~~~~~~~~~~~~~
        compilation terminated.
        mingw32-make[3]: *** [Makefile.Release:553: .obj/release/qmqttauthenticationproperties.o] Error 1
        mingw32-make[3]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src/mqtt'
        mingw32-make[2]: *** [Makefile:42: release-all] Error 2
        mingw32-make[2]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src/mqtt'
        mingw32-make[1]: *** [Makefile:43: sub-mqtt-make_first] Error 2
        mingw32-make[1]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src'
        mingw32-make: *** [Makefile:45: sub-src-make_first] Error 2

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #8

          Do you have Pearl Perl installed ?

          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
          • M Offline
            M Offline
            MScottM
            wrote on last edited by
            #9

            Pearl...haven't heard of it. Do you mean PERL the programming language? Either way, not on purpose - maybe if it snuck in as a part of another IDE, but I don't think so. Do I need it?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #10

              Indeed, auto-correct helped again...

              When building from git yes, you need it as there are scripts that are run one of which generates the forward headers.

              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
              • M Offline
                M Offline
                MScottM
                wrote on last edited by
                #11

                Huh! Okay - do I just grab the binary (Windows) from perl.org? Can I install that and just make sure the executable is in my Path?

                jsulmJ 1 Reply Last reply
                0
                • M MScottM

                  Huh! Okay - do I just grab the binary (Windows) from perl.org? Can I install that and just make sure the executable is in my Path?

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

                  @MScottM said in QMQTT:

                  Can I install that and just make sure the executable is in my Path?

                  Yes, should be enough.

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

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MScottM
                    wrote on last edited by
                    #13

                    So there were two options for Perl downloads from perl.org. ActivePerl, and StrawberryPerl - I chose ActivePerl. I installed, made sure it was in my path, rebooted for good luck, and tried the above steps again with the same result (failed on same file).

                    Did I download the wrong Perl?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      Did you nuke the build folder before restarting ?

                      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
                      • M Offline
                        M Offline
                        MScottM
                        wrote on last edited by
                        #15

                        Ah - no I didn't. Shall I delete the whole folder and move in a fresh copy? Also, am I using the correct methods - qmake, then mingw32-make?

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #16

                          Yes, delete the folder, you can then recreate it.

                          And yes, if you use the MinGW build of Qt. Note that you can also open the module in Qt Creator to do the build if you want.

                          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
                          • M Offline
                            M Offline
                            MScottM
                            wrote on last edited by
                            #17

                            Argghh!

                            Okay - I deleted the folder 'qtmqtt-5.12.3' in the /Src directory, and copied in a fresh version. Followed same steps as above, with the same results. I'm using the mingw32 terminal window from the same version of Qt to execute the commands.

                            How do I do it from within Qt Creator?

                            Also - thank you for the help so far.

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #18

                              I meant the build folder. Please use out of source builds so you keep the sources clean.

                              Just open the module as any other project.

                              Did you inspect the console output ? Was there any mention of a script failing ?

                              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
                              • M Offline
                                M Offline
                                MScottM
                                wrote on last edited by
                                #19

                                @SGaist - it didn't get as far as creating a build folder, and there still isn't one that I can find. I think I have some other weirdness going on...I haven't really done much in Qt5 after installing Qt6 (no time).

                                I tried opening the QtMqtt module in Qt5 Creator, and when it was time to select the kit to use there were two new ones called 'Replacement for "Desktop Qt 5.12.3 MinGW 64-bin"' and 'Replacement for "Desktop Qt 5.11.2 MinGW 32-bit"'. I could still select the usual kit I use, but now when 'Shadow build" is checked the path text is red and says the build directory doesn't exist.

                                Also tried building the Qt6 version of the module, in Qt6 Creator, which was also successful, but it also will not find the module with either qmake or cmake.

                                So my questions now are: -where does that usually point? Why do I have those two new kits (did Qt6 interfere?). And, can I put things back to 'normal'?

                                Oh, I did get the QtMqtt module to build after unchecking Shadow build, but when I try to add it to a new project (Qt += mqtt) it doesn't find the module.

                                SGaistS 1 Reply Last reply
                                0
                                • M MScottM

                                  @SGaist - it didn't get as far as creating a build folder, and there still isn't one that I can find. I think I have some other weirdness going on...I haven't really done much in Qt5 after installing Qt6 (no time).

                                  I tried opening the QtMqtt module in Qt5 Creator, and when it was time to select the kit to use there were two new ones called 'Replacement for "Desktop Qt 5.12.3 MinGW 64-bin"' and 'Replacement for "Desktop Qt 5.11.2 MinGW 32-bit"'. I could still select the usual kit I use, but now when 'Shadow build" is checked the path text is red and says the build directory doesn't exist.

                                  Also tried building the Qt6 version of the module, in Qt6 Creator, which was also successful, but it also will not find the module with either qmake or cmake.

                                  So my questions now are: -where does that usually point? Why do I have those two new kits (did Qt6 interfere?). And, can I put things back to 'normal'?

                                  Oh, I did get the QtMqtt module to build after unchecking Shadow build, but when I try to add it to a new project (Qt += mqtt) it doesn't find the module.

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

                                  @MScottM said in QMQTT:

                                  Oh, I did get the QtMqtt module to build after unchecking Shadow build, but when I try to add it to a new project (Qt += mqtt) it doesn't find the module.

                                  You forgot to call "make install" (or equivalent) after the build.

                                  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
                                  • M Offline
                                    M Offline
                                    MScottM
                                    wrote on last edited by
                                    #21

                                    Hmm, as I said - I opened it with Qt Creator and it built without errors. Is there a way to 'Install' from inside Creator?

                                    When I tried to execute mingw32-make install from the terminal window again, it fails exactly the same way 'QtMqtt/qmqttglobal.h: No such file or directory" even though I'm staring at the file in the folder.

                                    Here is the whole text:

                                    C:\Qt\5.12.3\Src\qtmqtt-5.12.3>mingw32-make install
                                    cd src\ && ( if not exist Makefile C:\Qt\5.12.3\mingw73_64\bin\qmake.exe -o Makefile C:\Qt\5.12.3\Src\qtmqtt-5.12.3\src\src.pro ) && mingw32-make -f Makefile install
                                    mingw32-make[1]: Entering directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src'
                                    cd mqtt\ && ( if not exist Makefile C:\Qt\5.12.3\mingw73_64\bin\qmake.exe -o Makefile C:\Qt\5.12.3\Src\qtmqtt-5.12.3\src\mqtt\mqtt.pro ) && mingw32-make -f Makefile install
                                    mingw32-make[2]: Entering directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src/mqtt'
                                    mingw32-make -f Makefile.Release install
                                    mingw32-make[3]: Entering directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src/mqtt'
                                    g++ -c -fno-keep-inline-dllexport -O2 -std=c++1z -fno-exceptions -Wall -W -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_MQTT_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I....\include -I....\include\QtMqtt -IC:/Qt/5.12.3/Src/qtmqtt-5.12.3/include/QtMqtt/5.12.3 -IC:/Qt/5.12.3/Src/qtmqtt-5.12.3/include/QtMqtt/5.12.3/QtMqtt -Itmp -IC:\Qt\5.12.3\mingw73_64\include -IC:\Qt\5.12.3\mingw73_64\include\QtNetwork -IC:\Qt\5.12.3\mingw73_64\include\QtCore\5.12.3 -IC:\Qt\5.12.3\mingw73_64\include\QtCore\5.12.3\QtCore -IC:\Qt\5.12.3\mingw73_64\include\QtCore -I.moc\release -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-winx64\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\5.12.3\mingw73_64\mkspecs\win32-g++ -o .obj\release\qmqttauthenticationproperties.o qmqttauthenticationproperties.cpp
                                    In file included from qmqttauthenticationproperties.cpp:30:0:
                                    qmqttauthenticationproperties.h:33:10: fatal error: QtMqtt/qmqttglobal.h: No such file or directory
                                    #include <QtMqtt/qmqttglobal.h>
                                    ^~~~~~~~~~~~~~~~~~~~~~
                                    compilation terminated.
                                    mingw32-make[3]: *** [Makefile.Release:553: .obj/release/qmqttauthenticationproperties.o] Error 1
                                    mingw32-make[3]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src/mqtt'
                                    mingw32-make[2]: *** [Makefile:48: release-install] Error 2
                                    mingw32-make[2]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src/mqtt'
                                    mingw32-make[1]: *** [Makefile:55: sub-mqtt-install_subtargets] Error 2
                                    mingw32-make[1]: Leaving directory 'C:/Qt/5.12.3/Src/qtmqtt-5.12.3/src'
                                    mingw32-make: *** [Makefile:57: sub-src-install_subtargets] Error 2

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      MScottM
                                      wrote on last edited by
                                      #22

                                      Hi @SGaist,

                                      Okay, so I went in and changed the #include statement in the offending file (qmqttauthenticationproperties.h) from '#include <QtMqtt/qmttglobal.h>' to '#include <qmttglobal.h>' and re-ran mingw32-make, and it now fails on the next #include statement in the file. Doesn't that mean there is a configuration problem somewhere that can be fixed for the overall qmake process?

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #23

                                        That is strange.

                                        One thing you can do is add a custom step in Qt Creator and call make install from it.

                                        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

                                        • Login

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