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
Forum Updated to NodeBB v4.3 + New Features

QtMqtt build

Scheduled Pinned Locked Moved Solved Installation and Deployment
6 Posts 3 Posters 1.2k 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.
  • P Offline
    P Offline
    PePoM
    wrote on last edited by PePoM
    #1

    I am trying to use QTMQTT in my project. I have successfully built a library, but problems occur when I try to include it in my project or run provided examples. I am using Qt 5.15.2 MinQW 64 on a windows machine.

    Steps taken:

    1. Download matching lib
    2. C:\qtmqtt-5.15.2> C:\Qt\5.15.2\mingw81_64\bin\qmake -r
    3. Make
    4. Make install
    C:\qtmqtt-5.15.2>make install
    cd src\ && ( if not exist Makefile C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -o Makefile C:\qtmqtt-5.15.2\src\src.pro ) && C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -f Makefile install
    make[1]: Entering directory 'C:/qtmqtt-5.15.2/src'
    cd mqtt\ && ( if not exist Makefile C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -o Makefile C:\qtmqtt-5.15.2\src\mqtt\mqtt.pro ) && C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -f Makefile install
    make[2]: Entering directory 'C:/qtmqtt-5.15.2/src/mqtt'
    C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -f Makefile.Release install
    make[3]: Entering directory 'C:/qtmqtt-5.15.2/src/mqtt'
    copy /y ..\..\lib\Qt5Mqtt.dll C:\Qt\5.15.2\mingw81_64\bin\Qt5Mqtt.dll
            1 file(s) copied.
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\lib\Qt5Mqtt.dll.debug C:\Qt\5.15.2\mingw81_64\lib\Qt5Mqtt.dll.debug
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install sed  -e "s,C:/qtmqtt-5.15.2/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\qtmqtt-5.15.2\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,C:/Qt/5.15.2/mingw81_64/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Qt\\\\5.15.2\\\\mingw81_64\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\lib\Qt5Mqtt.prl > C:\Qt\5.15.2\mingw81_64\lib\Qt5Mqtt.prl
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install sed  -e "s,C:/qtmqtt-5.15.2/lib,C:/Qt/5.15.2/mingw81_64/lib,g" -e "s,C:\\\\qtmqtt-5.15.2\\\\lib,C:\\\\Qt\\\\5.15.2\\\\mingw81_64\\\\lib,gi" ..\..\lib\pkgconfig\Qt5Mqtt.pc > C:\Qt\5.15.2\mingw81_64\lib\pkgconfig\Qt5Mqtt.pc
    copy /y ..\..\lib\libQt5Mqtt.a C:\Qt\5.15.2\mingw81_64\lib\libQt5Mqtt.a
            1 file(s) copied.
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\include\QtMqtt\QtMqttDepends C:\Qt\5.15.2\mingw81_64\include\QtMqtt\QtMqttDepends
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\mkspecs\modules-inst\qt_lib_mqtt.pri C:\Qt\5.15.2\mingw81_64\mkspecs\modules\qt_lib_mqtt.pri
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\mkspecs\modules-inst\qt_lib_mqtt_private.pri C:\Qt\5.15.2\mingw81_64\mkspecs\modules\qt_lib_mqtt_private.pri
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\lib\cmake\Qt5Mqtt\Qt5MqttConfig.cmake C:\Qt\5.15.2\mingw81_64\lib\cmake\Qt5Mqtt\Qt5MqttConfig.cmake
    C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\lib\cmake\Qt5Mqtt\Qt5MqttConfigVersion.cmake C:\Qt\5.15.2\mingw81_64\lib\cmake\Qt5Mqtt\Qt5MqttConfigVersion.cmake
    make[3]: Leaving directory 'C:/qtmqtt-5.15.2/src/mqtt'
    make[2]: Leaving directory 'C:/qtmqtt-5.15.2/src/mqtt'
    make[1]: Leaving directory 'C:/qtmqtt-5.15.2/src'
    

    I assume that installation is successful, but when I try to #include <QMqttClient> or <QtMqtt/QMqttClient> in a project I have an error "file not found" (I added QT += mqtt to pro file). When inspecting a folder, it appears that there is only one file, which is <QtMqtt/QtMqttDepends> nothing else. Did I miss any important step when building qtmqtt?.

    jsulmJ 1 Reply Last reply
    0
    • P PePoM

      I am trying to use QTMQTT in my project. I have successfully built a library, but problems occur when I try to include it in my project or run provided examples. I am using Qt 5.15.2 MinQW 64 on a windows machine.

      Steps taken:

      1. Download matching lib
      2. C:\qtmqtt-5.15.2> C:\Qt\5.15.2\mingw81_64\bin\qmake -r
      3. Make
      4. Make install
      C:\qtmqtt-5.15.2>make install
      cd src\ && ( if not exist Makefile C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -o Makefile C:\qtmqtt-5.15.2\src\src.pro ) && C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -f Makefile install
      make[1]: Entering directory 'C:/qtmqtt-5.15.2/src'
      cd mqtt\ && ( if not exist Makefile C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -o Makefile C:\qtmqtt-5.15.2\src\mqtt\mqtt.pro ) && C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -f Makefile install
      make[2]: Entering directory 'C:/qtmqtt-5.15.2/src/mqtt'
      C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -f Makefile.Release install
      make[3]: Entering directory 'C:/qtmqtt-5.15.2/src/mqtt'
      copy /y ..\..\lib\Qt5Mqtt.dll C:\Qt\5.15.2\mingw81_64\bin\Qt5Mqtt.dll
              1 file(s) copied.
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\lib\Qt5Mqtt.dll.debug C:\Qt\5.15.2\mingw81_64\lib\Qt5Mqtt.dll.debug
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install sed  -e "s,C:/qtmqtt-5.15.2/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\qtmqtt-5.15.2\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,C:/Qt/5.15.2/mingw81_64/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Qt\\\\5.15.2\\\\mingw81_64\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\lib\Qt5Mqtt.prl > C:\Qt\5.15.2\mingw81_64\lib\Qt5Mqtt.prl
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install sed  -e "s,C:/qtmqtt-5.15.2/lib,C:/Qt/5.15.2/mingw81_64/lib,g" -e "s,C:\\\\qtmqtt-5.15.2\\\\lib,C:\\\\Qt\\\\5.15.2\\\\mingw81_64\\\\lib,gi" ..\..\lib\pkgconfig\Qt5Mqtt.pc > C:\Qt\5.15.2\mingw81_64\lib\pkgconfig\Qt5Mqtt.pc
      copy /y ..\..\lib\libQt5Mqtt.a C:\Qt\5.15.2\mingw81_64\lib\libQt5Mqtt.a
              1 file(s) copied.
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\include\QtMqtt\QtMqttDepends C:\Qt\5.15.2\mingw81_64\include\QtMqtt\QtMqttDepends
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\mkspecs\modules-inst\qt_lib_mqtt.pri C:\Qt\5.15.2\mingw81_64\mkspecs\modules\qt_lib_mqtt.pri
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\mkspecs\modules-inst\qt_lib_mqtt_private.pri C:\Qt\5.15.2\mingw81_64\mkspecs\modules\qt_lib_mqtt_private.pri
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\lib\cmake\Qt5Mqtt\Qt5MqttConfig.cmake C:\Qt\5.15.2\mingw81_64\lib\cmake\Qt5Mqtt\Qt5MqttConfig.cmake
      C:\Qt\5.15.2\mingw81_64\bin\qmake.exe -install qinstall C:\qtmqtt-5.15.2\lib\cmake\Qt5Mqtt\Qt5MqttConfigVersion.cmake C:\Qt\5.15.2\mingw81_64\lib\cmake\Qt5Mqtt\Qt5MqttConfigVersion.cmake
      make[3]: Leaving directory 'C:/qtmqtt-5.15.2/src/mqtt'
      make[2]: Leaving directory 'C:/qtmqtt-5.15.2/src/mqtt'
      make[1]: Leaving directory 'C:/qtmqtt-5.15.2/src'
      

      I assume that installation is successful, but when I try to #include <QMqttClient> or <QtMqtt/QMqttClient> in a project I have an error "file not found" (I added QT += mqtt to pro file). When inspecting a folder, it appears that there is only one file, which is <QtMqtt/QtMqttDepends> nothing else. Did I miss any important step when building qtmqtt?.

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

      @PePoM I don't know why there are no other header files, but you could copy those manually from source folder to C:\Qt\5.15.2\mingw81_64\include\QtMqtt

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

      1 Reply Last reply
      0
      • P Offline
        P Offline
        PePoM
        wrote on last edited by PePoM
        #3

        Do You mean .h from cloned repo?
        8138bc74-f0d0-42e7-89aa-f38e8750b05e-image.png
        EDIT: I'll elaborate, building and linking 3rd party libs is confusing me(still noob at that part). I cloned qtmqtt repo then build it using "make". Now i have cloned repo polder E:/qtmqtt-5.15.2 and build folder
        ed20a382-b4f3-4e46-93af-f6cbe5729222-image.png
        Cloned repo contains headers(first image), build directory does not. When I explore Qt built in libraries I can see that every .h file has a corresponding file without extension (example QTCharts)
        1883813a-f38e-477a-b915-7de83c29664c-image.png
        Shouldn't I have a similar file structure in my built folder?

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

          Hi,

          Might be a silly question but did you checkout the 5.15.2 branch before building ?

          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
          • P Offline
            P Offline
            PePoM
            wrote on last edited by PePoM
            #5

            SGaist pointed me into the right direction. Simply downloading branch from github (even that it says 5.15.2) and running "make" does not work. Quick solution if someone has the same problem:
            make sure perl is instaled

            git clone https://github.com/qt/qtmqtt
            cd "to cloned repo"
            git checkout -b qtmatt-5.x.x
            git branch // make sure branch exists
            git clone https://github.com/qt/qtmqtt.git && git checkout v5.x.x

            Then you can "make" "make install". And now you should have all necessary files79f06331-c8e6-499d-bffc-6504273906c4-image.png

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

              The default branch when you clone Qt is the dev branch which is for Qt 6 currently.

              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

              • Login

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