Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. qtmqtt build on windows
Forum Updated to NodeBB v4.3 + New Features

qtmqtt build on windows

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
18 Posts 5 Posters 4.3k 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.
  • SGaistS SGaist

    Hi and welcome to devnet,

    There's no need to build the whole of Qt if you only need the QtMqtt module, just build it with the version you already use for development.

    Also, unless you plan to hack on Qt itself, drop the developer-build option.

    J Offline
    J Offline
    JungJIhyun
    wrote on last edited by JungJIhyun
    #4

    @SGaist @Pablo-J-Rogina

    Thanks for the your help.
    When I try qtmqtt build using mingw32-make below errors are come

    C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp:169:39: error: 'errorOccurred' is not a member of 'QAbstractSocket'
    connect(socket, &QAbstractSocket::errorOccurred, this, &QMqttConnection::transportError);
    ^~~~~~~~~~~~~
    C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp: In member function 'void QMqttConnection::finalize_connack()':
    C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp:1452:26: error: 'class QList<QMqttTopicName>' has no member named 'resize'; did you mean 'size'?
    m_receiveAliases.resize(m_clientPrivate->m_serverConnectionProperties.maximumTopicAlias());
    ^~~~~~
    size
    C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp:1453:26: error: 'class QList<QMqttTopicName>' has no member named 'resize'; did you mean 'size'?
    m_publishAliases.resize(m_clientPrivate->m_connectionProperties.maximumTopicAlias());
    ^~~~~~
    size
    mingw32-make[3]: *** [Makefile.Debug:1495: .obj/debug/qmqttconnection.o] Error 1

    Pablo J. RoginaP 1 Reply Last reply
    0
    • J JungJIhyun

      @SGaist @Pablo-J-Rogina

      Thanks for the your help.
      When I try qtmqtt build using mingw32-make below errors are come

      C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp:169:39: error: 'errorOccurred' is not a member of 'QAbstractSocket'
      connect(socket, &QAbstractSocket::errorOccurred, this, &QMqttConnection::transportError);
      ^~~~~~~~~~~~~
      C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp: In member function 'void QMqttConnection::finalize_connack()':
      C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp:1452:26: error: 'class QList<QMqttTopicName>' has no member named 'resize'; did you mean 'size'?
      m_receiveAliases.resize(m_clientPrivate->m_serverConnectionProperties.maximumTopicAlias());
      ^~~~~~
      size
      C:\Qt5\qt5\qtmqtt\src\mqtt\qmqttconnection.cpp:1453:26: error: 'class QList<QMqttTopicName>' has no member named 'resize'; did you mean 'size'?
      m_publishAliases.resize(m_clientPrivate->m_connectionProperties.maximumTopicAlias());
      ^~~~~~
      size
      mingw32-make[3]: *** [Makefile.Debug:1495: .obj/debug/qmqttconnection.o] Error 1

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #5

      @JungJIhyun said in qtmqtt build on windows:

      When I try qtmqtt build using mingw32-make below errors are come

      The idea is that you have Qt already installed, either by installing pre-built files for your OS or by building Qt yourself, before building mqtt module.

      Is that your case?
      Could you please describe your environment (OS, Qt version, how you installed it, etc.)?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1
      • A Offline
        A Offline
        AndreaFurlani
        wrote on last edited by
        #6

        I'm having the same issue using the last version of Qt and Qt Creator on Linux 20.04 .
        I used the following commands in the terminal:

        • git://code.qt.io/qt/qt5.git
        • cd qtmqtt
        • qmake .
        • make

        and the make command returns the same error described above:

        qmqttconnection.cpp: In member function ‘bool QMqttConnection::ensureTransport(bool)’:
        qmqttconnection.cpp:169:39: error: ‘errorOccurred’ is not a member of ‘QAbstractSocket’
          169 |     connect(socket, &QAbstractSocket::errorOccurred, this, &QMqttConnection::transportError);
              |                                       ^~~~~~~~~~~~~
        qmqttconnection.cpp: In member function ‘void QMqttConnection::finalize_connack()’:
        qmqttconnection.cpp:1452:26: error: ‘class QList<QMqttTopicName>’ has no member named ‘resize’; did you mean ‘size’?
         1452 |         m_receiveAliases.resize(m_clientPrivate->m_serverConnectionProperties.maximumTopicAlias());
              |                          ^~~~~~
              |                          size
        qmqttconnection.cpp:1453:26: error: ‘class QList<QMqttTopicName>’ has no member named ‘resize’; did you mean ‘size’?
         1453 |         m_publishAliases.resize(m_clientPrivate->m_connectionProperties.maximumTopicAlias());
              |                          ^~~~~~
              |                          size
        make[2]: *** [Makefile:660: .obj/qmqttconnection.o] Error 1
        make[2]: exit from directory «/home/furla/qtmqtt/src/mqtt»
        make[1]: *** [Makefile:47: sub-mqtt-make_first] Error 2
        make[1]: exit from directory «/home/furla/qtmqtt/src»
        make: *** [Makefile:49: sub-src-make_first] Error 2
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #7

          If you did nothing special, then you have the dev branch checked out. Switch the the branch matching 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

          A 1 Reply Last reply
          1
          • SGaistS SGaist

            If you did nothing special, then you have the dev branch checked out. Switch the the branch matching your Qt version.

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

            @SGaist Thank you for your fast reply, how can I do that?

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

              Using git checkout <name of the branch/tag>

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 2 Replies Last reply
              0
              • SGaistS SGaist

                Using git checkout <name of the branch/tag>

                A Offline
                A Offline
                AndreaFurlani
                wrote on last edited by
                #10
                This post is deleted!
                1 Reply Last reply
                0
                • SGaistS SGaist

                  Using git checkout <name of the branch/tag>

                  A Offline
                  A Offline
                  AndreaFurlani
                  wrote on last edited by
                  #11

                  @SGaist I downloaded the correct version (for Qt 5.15) but now it returns a new error:

                  In file included from qmqttauthenticationproperties.cpp:30:
                  qmqttauthenticationproperties.h:33:10: fatal error: QtMqtt/qmqttglobal.h: no such file or directory
                     33 | #include <QtMqtt/qmqttglobal.h>
                        |          ^~~~~~~~~~~~~~~~~~~~~~
                  compilation terminated.
                  make[2]: *** [Makefile:528: .obj/qmqttauthenticationproperties.o] Error 1
                  make[2]: exit from directory «/home/furla/Scaricati/qtmqtt/src/mqtt»
                  make[1]: *** [Makefile:47: sub-mqtt-make_first] Error 2
                  make[1]: exit from directory «/home/furla/Scaricati/qtmqtt/src»
                  make: *** [Makefile:49: sub-src-make_first] Error 2
                  
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    Did you cleanup before restarting 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
                    • A Offline
                      A Offline
                      AndreaFurlani
                      wrote on last edited by
                      #13

                      What do you mean with cleanup?

                      SGaistS 1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        AndreaFurlani
                        wrote on last edited by
                        #14

                        Following this thread https://forum.qt.io/topic/100705/how-can-i-use-the-qtmqtt-code/14 , I remove all the "QtMqtt" from the headers files, now I can build the project without errors.
                        On the other hand when I run the project, in the application output panel I get this error:

                        10:41:49: Starting /home/furla/Qt/EDALAB/build-qtmqtt-Desktop_Qt_5_15_0_GCC_64bit-Debug/examples/mqtt/consolepubsub/qtmqtt_pub ...
                        10:41:49: The process failed to start. Either the invoked program "/home/furla/Qt/EDALAB/build-qtmqtt-Desktop_Qt_5_15_0_GCC_64bit-Debug/examples/mqtt/consolepubsub/qtmqtt_pub" is missing, or you may have insufficient permissions to invoke the program.
                        10:41:49: Cannot execute "/home/furla/Qt/EDALAB/build-qtmqtt-Desktop_Qt_5_15_0_GCC_64bit-Debug/examples/mqtt/consolepubsub/qtmqtt_pub": no such File or directory
                        10:41:49: /home/furla/Qt/EDALAB/build-qtmqtt-Desktop_Qt_5_15_0_GCC_64bit-Debug/examples/mqtt/consolepubsub/qtmqtt_pub exited with code -1
                        

                        I looked into the folder and there are:

                        • MakeFile
                          *Makefile.qtmqtt_pub
                          *MakeFile.qtmqtt_sub

                        And if I use the command make in this folder I get this error:

                        In file included from /home/furla/Qt/EDALAB/qtmqtt-5.15/examples/mqtt/consolepubsub/main_pub.cpp:51:
                        /home/furla/Qt/EDALAB/qtmqtt-5.15/examples/mqtt/consolepubsub/configuration.h:59:10: fatal error: QMqttClient: no such File or directory
                           59 | #include <QMqttClient>
                              |          ^~~~~~~~~~~~~
                        compilation terminated.
                        make[1]: *** [Makefile.qtmqtt_pub:719: .obj/main_pub.o] Error 1
                        make[1]: exit from directory «/home/furla/Qt/EDALAB/build-qtmqtt-Desktop_Qt_5_15_0_GCC_64bit-Debug/examples/mqtt/consolepubsub»
                        make: *** [Makefile:61: sub-qtmqtt_pub-pro-install_subtargets-ordered] Error 2
                        
                        1 Reply Last reply
                        0
                        • A AndreaFurlani

                          What do you mean with cleanup?

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

                          @AndreaFurlani said in qtmqtt build on windows:

                          What do you mean with cleanup?

                          Nuke the build folder to ensure there's no stuff from your failed attempt that will influence this new one.

                          Then ensure you have all the required tools to build Qt from git since you cloned the sources from there. Since you are on Linux, it is likely the case but better check then guess.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          A 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            @AndreaFurlani said in qtmqtt build on windows:

                            What do you mean with cleanup?

                            Nuke the build folder to ensure there's no stuff from your failed attempt that will influence this new one.

                            Then ensure you have all the required tools to build Qt from git since you cloned the sources from there. Since you are on Linux, it is likely the case but better check then guess.

                            A Offline
                            A Offline
                            AndreaFurlani
                            wrote on last edited by AndreaFurlani
                            #16

                            @SGaist Ok I already deleted everything before to retry and as I described above I'm getting a new error.
                            I think I have all the right tools installed and also the Qt Creator options should be ok since I can run every example project without problems.
                            Moreover, instead of using the command clone, I maually downloaded the .zip folder from git corresponding to my Qt version

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

                              Can you give what your actual state is now ?
                              Did you build the module successfully ?
                              If so, did you call the equivalent of make install ?

                              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
                              • ThirdStrandT Offline
                                ThirdStrandT Offline
                                ThirdStrand
                                wrote on last edited by
                                #18

                                For other searchers!

                                There is a dependency package, at least on RPi by the name of:

                                qt5base-private-dev

                                in order to build qtmqtt.

                                @SGaist , thanks for the prompt on git checkout <version> as I keep forgetting that detail when seeking a specific version.

                                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