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

Installing MQTT library

Scheduled Pinned Locked Moved Solved Installation and Deployment
15 Posts 2 Posters 5.9k 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi
    Can you try with
    QT += core-private
    in the .pro file ?
    Make sure to do a make clean first and then retry

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Inso
      wrote on last edited by
      #3

      Just to be sure I did it right:

      the installation attemp was made using the Ubuntu terminal.

      I now have my open project within the qtcreator. There is a .pro-file (named as my project), where I already added "QT += mqtt".
      When I now clean the project, I get the error

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

      so I comment it out, add "QT += core-private", save and clean the project, no errors.

      Then I again open the Ubuntu terminal, and enter
      /usr/bin/qtcreator/qmake
      make

      This results in the same error as above.

      mrjjM 1 Reply Last reply
      0
      • I Inso

        Just to be sure I did it right:

        the installation attemp was made using the Ubuntu terminal.

        I now have my open project within the qtcreator. There is a .pro-file (named as my project), where I already added "QT += mqtt".
        When I now clean the project, I get the error

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

        so I comment it out, add "QT += core-private", save and clean the project, no errors.

        Then I again open the Ubuntu terminal, and enter
        /usr/bin/qtcreator/qmake
        make

        This results in the same error as above.

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @Inso
        so it can still not find qobject_p.h ?
        have you check that you have this file ?

        sudo updatedb
        locate qobject_p.h
        

        (not sure Debian has locate but try )

        also where did you download qtmqtt source from ?

        1 Reply Last reply
        0
        • I Offline
          I Offline
          Inso
          wrote on last edited by
          #5

          by executing apt-get install locate I was able to run commands updatedb and locate, both did not result in an output. So I´d assume it is not found?

          qtmqtt source was downloaded from https://code.qt.io/qt/qtmqtt.git

          mrjjM 1 Reply Last reply
          0
          • I Inso

            by executing apt-get install locate I was able to run commands updatedb and locate, both did not result in an output. So I´d assume it is not found?

            qtmqtt source was downloaded from https://code.qt.io/qt/qtmqtt.git

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @Inso
            Hi
            yes if locate returns nothing then its not found.

            the url says Not found but i assume you use git clone ?
            Asking as im going to try it in my linux Mint. Not debian but as least related :)

            1 Reply Last reply
            0
            • I Offline
              I Offline
              Inso
              wrote on last edited by
              #7

              Right, I found the tutorials

              from stackoverflow

              and

              diy.ind.in

              where I took partial instructions from.

              My Debian 10 x64 is running on VMWare Workstation Player 15.

              mrjjM 1 Reply Last reply
              0
              • I Inso

                Right, I found the tutorials

                from stackoverflow

                and

                diy.ind.in

                where I took partial instructions from.

                My Debian 10 x64 is running on VMWare Workstation Player 15.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @Inso
                Hi
                Odd. I get same error and i do have the file :)
                /home/xx/Qt/5.14.1/gcc_64/include/QtCore/5.14.1/QtCore/private/qobject_p.h

                But then i open the .pro file in creator and then it just build.

                So I guess it a path issue from the shell.

                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  Inso
                  wrote on last edited by
                  #9

                  @mrjj said in Installing MQTT library:

                  gcc_64

                  I cannot find the folder gcc_64 on my machine, which should contain qobject_p.h

                  I downloaded the whole OS to windows to search there again, it is definitely not there.
                  Then I tried to reinstall gcc, no packages were loaded.
                  find / -name gcc
                  returned

                  /usr/bin/gcc
                  /usr/share/lintian/overrides/gcc
                  /usr/share/doc/gcc-8-base/gcc
                  /usr/share/doc/gcc
                  /usr/share/bash-completion/completions/gcc
                  /usr/lib/gcc
                  

                  and, I can find the compiler as 32bit among the compilers in Qt.
                  Semms to be installed fine, but only in 32 bit:

                  inso@debian:~$ whereis gcc make
                  gcc: /usr/bin/gcc /usr/lib/gcc
                  make: /usr/bin/make /usr/share/man/man1/make.1.gz
                  
                  inso@debian:~$ gcc -v
                  Using built-in specs.
                  COLLECT_GCC=gcc
                  COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
                  OFFLOAD_TARGET_NAMES=nvptx-none
                  OFFLOAD_TARGET_DEFAULT=1
                  Target: x86_64-linux-gnu
                  Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
                  Thread model: posix
                  gcc version 8.3.0 (Debian 8.3.0-6) 
                  

                  As it seems not to be installable later including the needed files, I now plan to build the virtual machine from scratch tomorrow, and instead of the terminal command used for installing Qt before, I now install by the online installer. Hopefully, this brings me the gcc-folder with the appropriate files, and also the folder management will be as it is by default.

                  A second thing, assuming the same problem will occur (which seems obvious, as you had it too):
                  Atm I am unsure how it works just opening the .pro file (qtmqtt.pro I´s assume). As I understand, atm on my machine the lib is not even installed as componnents are missing, no way.
                  In your case, you verified the file is vailable. But you weren´t able to install the library, did I understand that right? And then you just open the file after opening your project, just by drag n drop to the editor, so the editor has loaded it besides the project and uses the path you chose while cloning to access the files? And then, everytime you work with this project, you have to open the .pro file separately?

                  mrjjM 1 Reply Last reply
                  0
                  • I Inso

                    @mrjj said in Installing MQTT library:

                    gcc_64

                    I cannot find the folder gcc_64 on my machine, which should contain qobject_p.h

                    I downloaded the whole OS to windows to search there again, it is definitely not there.
                    Then I tried to reinstall gcc, no packages were loaded.
                    find / -name gcc
                    returned

                    /usr/bin/gcc
                    /usr/share/lintian/overrides/gcc
                    /usr/share/doc/gcc-8-base/gcc
                    /usr/share/doc/gcc
                    /usr/share/bash-completion/completions/gcc
                    /usr/lib/gcc
                    

                    and, I can find the compiler as 32bit among the compilers in Qt.
                    Semms to be installed fine, but only in 32 bit:

                    inso@debian:~$ whereis gcc make
                    gcc: /usr/bin/gcc /usr/lib/gcc
                    make: /usr/bin/make /usr/share/man/man1/make.1.gz
                    
                    inso@debian:~$ gcc -v
                    Using built-in specs.
                    COLLECT_GCC=gcc
                    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
                    OFFLOAD_TARGET_NAMES=nvptx-none
                    OFFLOAD_TARGET_DEFAULT=1
                    Target: x86_64-linux-gnu
                    Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
                    Thread model: posix
                    gcc version 8.3.0 (Debian 8.3.0-6) 
                    

                    As it seems not to be installable later including the needed files, I now plan to build the virtual machine from scratch tomorrow, and instead of the terminal command used for installing Qt before, I now install by the online installer. Hopefully, this brings me the gcc-folder with the appropriate files, and also the folder management will be as it is by default.

                    A second thing, assuming the same problem will occur (which seems obvious, as you had it too):
                    Atm I am unsure how it works just opening the .pro file (qtmqtt.pro I´s assume). As I understand, atm on my machine the lib is not even installed as componnents are missing, no way.
                    In your case, you verified the file is vailable. But you weren´t able to install the library, did I understand that right? And then you just open the file after opening your project, just by drag n drop to the editor, so the editor has loaded it besides the project and uses the path you chose while cloning to access the files? And then, everytime you work with this project, you have to open the .pro file separately?

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by mrjj
                    #10

                    @Inso said in Installing MQTT library:

                    But you weren´t able to install the library, did I understand that right?

                    Not using the terminal and qmake but i then open the pro file in Creator and
                    it build it. (yes simply go to File open project and browse to the qtmqtt.pro in where ever you did git clone to )

                    Then I added a build step to do "make install"
                    and ran again and it installed it and i was able to use it in a project.

                    qobject_p.h is not part of gcc install but should be part of the Qt install.
                    the gcc_64 path comes from the Qt. Not related to the gcc compiler as such.

                    But yes one diff can be you use the distro provided Qt and i installed via Qt installer.

                    • And then, everytime you work with this project, you have to open the .pro file separately?

                    No. It installed as a module and i can use it with
                    QT += mqtt
                    in a clean project.

                    1 Reply Last reply
                    1
                    • I Offline
                      I Offline
                      Inso
                      wrote on last edited by
                      #11

                      Just a little update:
                      bilding on this machine using the pro file in qt leads to:

                      Project ERROR: Failed to run: perl -w /usr/lib/qt5/bin/syncqt.pl -module QtMqtt -version 5.15.0 -outdir '' -builddir '' /home/inso/qtmqtt
                      

                      Building on a machine using an online installer Qt works. Sadly Qt chashes on this machine, with no solution (see other thread). As I cannot install the Qt 12.x used by the machine where Qt is running fine, the running lib and running Qt are not compatible.
                      Woohoo
                      I now try to install Qt on my native Windows machine. First try building mqtt endet in problems of the linker, I will waste the third evening trying to get the IDE running.

                      If this will not result in an success, I deinstall Qt and switch to Java or .net. I know normally they sell Qt, seems they are not very interested in spreading the free version.

                      However @mrii, you also took a lot of time taking a look at my problems. Thank you very much for that!

                      mrjjM 1 Reply Last reply
                      0
                      • I Inso

                        Just a little update:
                        bilding on this machine using the pro file in qt leads to:

                        Project ERROR: Failed to run: perl -w /usr/lib/qt5/bin/syncqt.pl -module QtMqtt -version 5.15.0 -outdir '' -builddir '' /home/inso/qtmqtt
                        

                        Building on a machine using an online installer Qt works. Sadly Qt chashes on this machine, with no solution (see other thread). As I cannot install the Qt 12.x used by the machine where Qt is running fine, the running lib and running Qt are not compatible.
                        Woohoo
                        I now try to install Qt on my native Windows machine. First try building mqtt endet in problems of the linker, I will waste the third evening trying to get the IDE running.

                        If this will not result in an success, I deinstall Qt and switch to Java or .net. I know normally they sell Qt, seems they are not very interested in spreading the free version.

                        However @mrii, you also took a lot of time taking a look at my problems. Thank you very much for that!

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @Inso
                        Hi
                        I hope it works this time.
                        Normally there is not many issues with installing Qt
                        but seems you are particularly unlucky.

                        Is this all on debian virtual machines ?

                        1 Reply Last reply
                        0
                        • I Offline
                          I Offline
                          Inso
                          wrote on last edited by
                          #13

                          The above mentioned errors are both on debian machines. One builds the Lib, one builds the project.

                          I now installed on Win10 home x64, opening mqtt.pro using QtCreator, and building does not find the other header files, as he does not seem to like the "QtMqtt/". Deleting it, some calls are ambiguous, so no way building it this way here.

                          I then installed GNUWin32 and tried to build it whis way. Started cmd as administrator, however, he says

                          D:\QtLibs\qtmqtt>D:\GnuWin32\bin\make
                          cd src\ && ( if not exist Makefile D:\Qt\5.15.0\mingw81_64\bin\qmake.exe -o Makefile D:\QtLibs\qtmqtt\src\src.pro ) && D:/GnuWin32/bin/make -f Makefile
                          make[1]: Entering directory `D:/QtLibs/qtmqtt/src'
                          cd mqtt\ && ( if not exist Makefile D:\Qt\5.15.0\mingw81_64\bin\qmake.exe -o Makefile D:\QtLibs\qtmqtt\src\mqtt\mqtt.pro ) && D:/GnuWin32/bin/make -f Makefile
                          make[2]: Entering directory `D:/QtLibs/qtmqtt/src/mqtt'
                          D:/GnuWin32/bin/make -f Makefile.Release
                          make[3]: Entering directory `D:/QtLibs/qtmqtt/src/mqtt'
                          g++ -c -fno-keep-inline-dllexport -O2 -g -std=c++1z -fno-exceptions -Wall -Wextra -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_LINKED_LIST -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -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_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\include -I..\..\include\QtMqtt -ID:/QtLibs/qtmqtt/include/QtMqtt/5.15.0 -ID:/QtLibs/qtmqtt/include/QtMqtt/5.15.0/QtMqtt -Itmp -ID:\Qt\5.15.0\mingw81_64\include -ID:\Qt\5.15.0\mingw81_64\include\QtNetwork -ID:\Qt\5.15.0\mingw81_64\include\QtCore\5.15.0 -ID:\Qt\5.15.0\mingw81_64\include\QtCore\5.15.0\QtCore -ID:\Qt\5.15.0\mingw81_64\include\QtCore -I.moc\release -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-winx64\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.15.0\mingw81_64\mkspecs\win32-g++  -o .obj\release\qmqttauthenticationproperties.o qmqttauthenticationproperties.cpp
                          process_begin: CreateProcess(NULL, g++ -c -fno-keep-inline-dllexport -O2 -g -std=c++1z -fno-exceptions -Wall -Wextra -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_LINKED_LIST -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -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_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I..\..\include -I..\..\include\QtMqtt -ID:/QtLibs/qtmqtt/include/QtMqtt/5.15.0 -ID:/QtLibs/qtmqtt/include/QtMqtt/5.15.0/QtMqtt -Itmp -ID:\Qt\5.15.0\mingw81_64\include -ID:\Qt\5.15.0\mingw81_64\include\QtNetwork -ID:\Qt\5.15.0\mingw81_64\include\QtCore\5.15.0 -ID:\Qt\5.15.0\mingw81_64\include\QtCore\5.15.0\QtCore -ID:\Qt\5.15.0\mingw81_64\include\QtCore -I.moc\release -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-winx64\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.15.0\mingw81_64\mkspecs\win32-g++ -o .obj\release\qmqttauthenticationproperties.o qmqttauthenticationproperties.cpp, ...) failed.
                          make (e=2): Das System kann die angegebene Datei nicht finden.
                          make[3]: *** [.obj/release/qmqttauthenticationproperties.o] Fehler 2
                          make[3]: Leaving directory `D:/QtLibs/qtmqtt/src/mqtt'
                          make[2]: *** [release] Fehler 2
                          make[2]: Leaving directory `D:/QtLibs/qtmqtt/src/mqtt'
                          make[1]: *** [sub-mqtt-make_first] Fehler 2
                          make[1]: Leaving directory `D:/QtLibs/qtmqtt/src'
                          make: *** [sub-src-make_first] Fehler 2
                          

                          and again, an unsuccessful build.

                          I have some experience in VB6, VB.net, C++, C#, .net, Java, JavaScript and Python. I got PlatformIO to work flawlessly with my ESP32, Arduino and STM32. And I never, NEVER had problems with an IDE even close to this. Wow.

                          Maybe someone could just upload his Qt5Mqtt.dll build on last stable (Qt 5.14.2) using Windows, so I can just copy it over? No matter I cannot debug on my Raspi, I´d just like to finish the project someway. Four free days and three are gone, would be awesome if I finally could get some to work before the long weekend is completely lost.

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

                            Hi
                            Just tried on win 10. Qt 5.14.2
                            I took other version than default from GIT

                            git clone https://code.qt.io/qt/qtmqtt.git --branch 5.14.2

                            Then i open pro file and it just build. (visual studio 2017)
                            alt text

                            Do note i have perl installed as thats an requiment for building Qt and also modules
                            https://www.activestate.com/products/perl/downloads/
                            might also work http://strawberryperl.com/

                            I dont think the DLLs alone will do you much good as you cant do
                            make install with them and i think the includes will be mising.
                            but you are welcome to have them but do note its visual studio 2017 so
                            cannto be used with mingw.

                            I 1 Reply Last reply
                            0
                            • mrjjM mrjj

                              Hi
                              Just tried on win 10. Qt 5.14.2
                              I took other version than default from GIT

                              git clone https://code.qt.io/qt/qtmqtt.git --branch 5.14.2

                              Then i open pro file and it just build. (visual studio 2017)
                              alt text

                              Do note i have perl installed as thats an requiment for building Qt and also modules
                              https://www.activestate.com/products/perl/downloads/
                              might also work http://strawberryperl.com/

                              I dont think the DLLs alone will do you much good as you cant do
                              make install with them and i think the includes will be mising.
                              but you are welcome to have them but do note its visual studio 2017 so
                              cannto be used with mingw.

                              I Offline
                              I Offline
                              Inso
                              wrote on last edited by
                              #15

                              @mrjj
                              I took a few days off, now it worked.
                              The magic was not to use the last GIT version, as you did.
                              I have chosen now the one closest to my QT-Version, which resulted in success both on raspbian and windows.
                              Thanks again for your help !

                              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