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. Compile MQTT library & need to update to latest 5.11
Forum Update on Monday, May 27th 2025

Compile MQTT library & need to update to latest 5.11

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
31 Posts 6 Posters 9.6k 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.
  • B Offline
    B Offline
    bhu24
    wrote on last edited by
    #1

    Hie
    I want to use MQTT for my project but i am unable to use "qtmqtt" library as i follow mostly possible solution but it fails
    one of the step which i follow:

    add in .pro file
    QT += mqtt

    To use a Qt module, it must be installed in the Qt lib directory.
    First, retrieve the lib directory path executing this command from a terminal:

    qmake -query QT_INSTALL_LIBS

    Cd into that directory and check if a file called Qt5Mqtt.dll is there: if not, you must build/install the module.
    To get the module source code, you can execute this git command:

    git clone git://code.qt.io/qt/qtmqtt.git

    Once you have the source files, cd into the source files directory containing the file qtmqtt.pro and run these commands:

    qmake
    make
    make install

    (you may need administrator privileges for the last one).
    After the commands completed successfully, you should be able to see the library in the QT_INSTALL_LIBS directory, and use the module in a Qt project.

    In case of compilation issues, open the qtmqtt.pro file with creator, and try to build the library from there, then manually install (copy) it into the QT_INSTALL_LIBS.

    ( 2 ) platform details is as follow :

    O.S => Ubuntu 14.04
    QT => qt Creator 4.8.1
    QMake version 3.0
    Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

    is i want to update to qt version 5.11 so is it possible on "ubuntu 14.04"?? on update ubuntu to 16.04???
    because i already tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

    1 Reply Last reply
    0
    • kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on last edited by kkoehne
      #2

      Hi, and welcome to the forum.

      It's unclear to me what exactly fails for you. Have you followed the steps described? Is something in the manual unclear to you?

      Director R&D, The Qt Company

      1 Reply Last reply
      4
      • B Offline
        B Offline
        bhu24
        wrote on last edited by
        #3

        Thanks for reply.
        Actually problem is "qtmqtt" is not compile on my Qt creator.
        Yes, i followed described steps.
        Please let me know this problem is because of qt 5.2.1 version???
        i read somewhere for "qtmqtt" compilation required higher version of >5.7 so on my ubuntu 14.04 please let me know how to install higher version.!! As mentioned in question as follows:

        O.S => Ubuntu 14.04
        QT => qt Creator 4.8.1
        QMake version 3.0
        Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

        if i want to update to qt version 5.11 so is it possible on "ubuntu 14.04"?? or update ubuntu to 16.04???
        because i already tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

        Thanks for help!

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

          @bhu24 said in Compile MQTT library & need to update to latest 5.11:

          because i already tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

          And what happened? (We want the exact error message!)

          1 Reply Last reply
          0
          • B bhu24

            Thanks for reply.
            Actually problem is "qtmqtt" is not compile on my Qt creator.
            Yes, i followed described steps.
            Please let me know this problem is because of qt 5.2.1 version???
            i read somewhere for "qtmqtt" compilation required higher version of >5.7 so on my ubuntu 14.04 please let me know how to install higher version.!! As mentioned in question as follows:

            O.S => Ubuntu 14.04
            QT => qt Creator 4.8.1
            QMake version 3.0
            Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

            if i want to update to qt version 5.11 so is it possible on "ubuntu 14.04"?? or update ubuntu to 16.04???
            because i already tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

            Thanks for help!

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • B Offline
              B Offline
              bhu24
              wrote on last edited by
              #6

              Question ->. because i already tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

              Answer :- it not given error is installed version of 5.2.1 on system
              QMake version 3.0
              Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

              1. When run from terminal got following error after running "sudo make" Command
                .
                .
                .
                .
                In file included from qmqttclient.cpp:31:0:
                qmqttclient_p.h:49:31: fatal error: private/qobject_p.h: No such file or directory
                #include <private/qobject_p.h>
                ^
                compilation terminated.
                make[2]: *** [.obj/qmqttclient.o] Error 1
                make[2]: Leaving directory /home/balkrishna/qtmqtt/src/mqtt' make[1]: *** [sub-mqtt-make_first] Error 2 make[1]: Leaving directory /home/balkrishna/qtmqtt/src'
                make: *** [sub-src-make_first] Error 2

              2. qtmqtt.pro file with creator, i try to build library then Got following error

              /home/balkrishna/qtmqtt/src/mqtt/qmqttclient_p.h:49: error: private/qobject_p.h: No such file or directory
              #include <private/qobject_p.h>
              ^

              aha_1980A 1 Reply Last reply
              0
              • B bhu24

                Question ->. because i already tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

                Answer :- it not given error is installed version of 5.2.1 on system
                QMake version 3.0
                Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

                1. When run from terminal got following error after running "sudo make" Command
                  .
                  .
                  .
                  .
                  In file included from qmqttclient.cpp:31:0:
                  qmqttclient_p.h:49:31: fatal error: private/qobject_p.h: No such file or directory
                  #include <private/qobject_p.h>
                  ^
                  compilation terminated.
                  make[2]: *** [.obj/qmqttclient.o] Error 1
                  make[2]: Leaving directory /home/balkrishna/qtmqtt/src/mqtt' make[1]: *** [sub-mqtt-make_first] Error 2 make[1]: Leaving directory /home/balkrishna/qtmqtt/src'
                  make: *** [sub-src-make_first] Error 2

                2. qtmqtt.pro file with creator, i try to build library then Got following error

                /home/balkrishna/qtmqtt/src/mqtt/qmqttclient_p.h:49: error: private/qobject_p.h: No such file or directory
                #include <private/qobject_p.h>
                ^

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @bhu24

                I don't think QtMQTT will work with Qt 5.2.1.

                My questions was, what happened when you:

                tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

                ?

                B 1 Reply Last reply
                0
                • aha_1980A aha_1980

                  @bhu24

                  I don't think QtMQTT will work with Qt 5.2.1.

                  My questions was, what happened when you:

                  tried offline installer using "qt-opensource-linux-x64-5.11.1.run" file

                  ?

                  B Offline
                  B Offline
                  bhu24
                  wrote on last edited by
                  #8

                  @aha_1980
                  i already told you about the same

                  Answer :- it installed successfully but after installation got "qt version of 5.2.1" on ubuntu 14.04 system instead of "qt version of 5.11.1"

                  Command to check qt version
                  => qmake --version
                  => QMake version 3.0
                  Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

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

                    Hi,

                    Use the full path to the qmake executable of the Qt version your want to use.

                    You are currently using your distribution provided Qt.

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

                    B 1 Reply Last reply
                    2
                    • B bhu24

                      @aha_1980
                      i already told you about the same

                      Answer :- it installed successfully but after installation got "qt version of 5.2.1" on ubuntu 14.04 system instead of "qt version of 5.11.1"

                      Command to check qt version
                      => qmake --version
                      => QMake version 3.0
                      Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu

                      aha_1980A Offline
                      aha_1980A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @bhu24

                      Answer :- it installed successfully but after installation got "qt version of 5.2.1" on ubuntu 14.04 system instead of "qt version of 5.11.1"

                      Ah sorry, I didn't get this :(

                      As @SGaist said, you must call qmake with full path if you have multiple versions installed.

                      But then it should work - good luck.

                      Regards

                      1 Reply Last reply
                      1
                      • SGaistS SGaist

                        Hi,

                        Use the full path to the qmake executable of the Qt version your want to use.

                        You are currently using your distribution provided Qt.

                        B Offline
                        B Offline
                        bhu24
                        wrote on last edited by
                        #11

                        @SGaist thanks got qmake 5.11.1 and now got error while compiling "qtmqtt" Library

                        error: error: unrecognized command line option '-std=c++1z'
                        error: error: unrecognized command line option '-Wdate-time'

                        @aha_1980 thnaks to you also

                        aha_1980A 1 Reply Last reply
                        0
                        • B bhu24

                          @SGaist thanks got qmake 5.11.1 and now got error while compiling "qtmqtt" Library

                          error: error: unrecognized command line option '-std=c++1z'
                          error: error: unrecognized command line option '-Wdate-time'

                          @aha_1980 thnaks to you also

                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @bhu24 said in Compile MQTT library & need to update to latest 5.11:

                          error: error: unrecognized command line option '-std=c++1z'

                          I'm not sure why c++1z (= "c++17") is forced, but your compiler may be too old for that.

                          Can you see if c++1z is given in any of the .pro or .pri files?

                          B 1 Reply Last reply
                          0
                          • aha_1980A aha_1980

                            @bhu24 said in Compile MQTT library & need to update to latest 5.11:

                            error: error: unrecognized command line option '-std=c++1z'

                            I'm not sure why c++1z (= "c++17") is forced, but your compiler may be too old for that.

                            Can you see if c++1z is given in any of the .pro or .pri files?

                            B Offline
                            B Offline
                            bhu24
                            wrote on last edited by
                            #13

                            @aha_1980 still issue is not resolved

                            Previous - error: error: unrecognized command line option '-std=c++1z'
                            NEW - error: [.pch/Qt5Mqtt.gch/c++] Error 1

                            one error gone but new issue arise!!!

                            Solved issue - error: error: unrecognized command line option '-Wdate-time'

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

                              That's because you're currently using an out of date compiler.

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

                                ![alt text](2_1532584676910_qt_settings3.png 1_1532584676910_qt_settings2.png 0_1532584676910_qt_settings1.png image url)

                                Here i am sending screenshot's of my 1. Qt version 2. Compilers 3. Cmake
                                So please let me is any thing i am missing so facing this issue!!!!!!

                                jsulmJ 1 Reply Last reply
                                0
                                • B bhu24

                                  ![alt text](2_1532584676910_qt_settings3.png 1_1532584676910_qt_settings2.png 0_1532584676910_qt_settings1.png image url)

                                  Here i am sending screenshot's of my 1. Qt version 2. Compilers 3. Cmake
                                  So please let me is any thing i am missing so facing this issue!!!!!!

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

                                  @bhu24 This is quite a big list of compilers! Do you really need all of them (4.7, 4.8, 4.9)?
                                  Which compiler do you use? Which is set as compiler in the Kit you're using?

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

                                  B 1 Reply Last reply
                                  1
                                  • jsulmJ jsulm

                                    @bhu24 This is quite a big list of compilers! Do you really need all of them (4.7, 4.8, 4.9)?
                                    Which compiler do you use? Which is set as compiler in the Kit you're using?

                                    B Offline
                                    B Offline
                                    bhu24
                                    wrote on last edited by
                                    #17

                                    @jsulm my requirement is to compile "MQTT" library which need qt 5.11.1 higher version and compiler 4.9 as per my knowledge please suggest me solution on same.
                                    Thanks for help!!

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • B bhu24

                                      @jsulm my requirement is to compile "MQTT" library which need qt 5.11.1 higher version and compiler 4.9 as per my knowledge please suggest me solution on same.
                                      Thanks for help!!

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

                                      @bhu24 Did you check whether GCC 4.9 is really set in your Kit?

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

                                      B 1 Reply Last reply
                                      1
                                      • jsulmJ jsulm

                                        @bhu24 Did you check whether GCC 4.9 is really set in your Kit?

                                        B Offline
                                        B Offline
                                        bhu24
                                        wrote on last edited by bhu24
                                        #19

                                        @jsulm yes as you can see in screen shot

                                        1. Got compiler output window as follows:
                                          home/balkrishna/Desktop/qt/qtmqtt/include/QtMqtt/QtMqttDepends -o .pch/Qt5Mqtt.gch/c++
                                          g++: error: unrecognized command line option '-std=c++1z'
                                          make[2]: Leaving directory /home/balkrishna/build-qtmqtt-Qt_5_11_1-Debug/src/mqtt' make[1]: Leaving directory /home/balkrishna/build-qtmqtt-Qt_5_11_1-Debug/src'
                                          make[2]: *** [.pch/Qt5Mqtt.gch/c++] Error 1
                                          make[1]: *** [sub-mqtt-make_first] Error 2
                                          make: *** [sub-src-make_first] Error 2
                                          12:29:01: The process "/usr/bin/make" exited with code 2.
                                          Error while building/deploying project qtmqtt (kit: Qt 5.11.1)
                                          When executing step 'Make'

                                        2. In Genral message window shows following :

                                        /home/balkrishna/Qt5.11.1/5.11.1/gcc_64/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
                                        Project ERROR: Library '' is not defined.
                                        /home/balkrishna/Qt5.11.1/5.11.1/gcc_64/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
                                        Project ERROR: Library '' is not defined.

                                        1. In Issue window show following:

                                        error: error: unrecognized command line option '-std=c++1z'
                                        error: [.pch/Qt5Mqtt.gch/c++] Error 1

                                        Any thing is wrong from my side so please let me know and suggest which things should i cross check to resolve this issue

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • B bhu24

                                          @jsulm yes as you can see in screen shot

                                          1. Got compiler output window as follows:
                                            home/balkrishna/Desktop/qt/qtmqtt/include/QtMqtt/QtMqttDepends -o .pch/Qt5Mqtt.gch/c++
                                            g++: error: unrecognized command line option '-std=c++1z'
                                            make[2]: Leaving directory /home/balkrishna/build-qtmqtt-Qt_5_11_1-Debug/src/mqtt' make[1]: Leaving directory /home/balkrishna/build-qtmqtt-Qt_5_11_1-Debug/src'
                                            make[2]: *** [.pch/Qt5Mqtt.gch/c++] Error 1
                                            make[1]: *** [sub-mqtt-make_first] Error 2
                                            make: *** [sub-src-make_first] Error 2
                                            12:29:01: The process "/usr/bin/make" exited with code 2.
                                            Error while building/deploying project qtmqtt (kit: Qt 5.11.1)
                                            When executing step 'Make'

                                          2. In Genral message window shows following :

                                          /home/balkrishna/Qt5.11.1/5.11.1/gcc_64/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
                                          Project ERROR: Library '' is not defined.
                                          /home/balkrishna/Qt5.11.1/5.11.1/gcc_64/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
                                          Project ERROR: Library '' is not defined.

                                          1. In Issue window show following:

                                          error: error: unrecognized command line option '-std=c++1z'
                                          error: [.pch/Qt5Mqtt.gch/c++] Error 1

                                          Any thing is wrong from my side so please let me know and suggest which things should i cross check to resolve this issue

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

                                          @bhu24 said in Compile MQTT library & need to update to latest 5.11:

                                          yes as you can see in screen shot

                                          No, I can't as you did not post the screen-shot of your Kit...

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

                                          B 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