Unsolved qtmqtt build on windows
-
Hello~
I want to use qtmqtt module for my application.so I downloaded source code from below git
git://code.qt.io/qt/qt5.gitand I downloaded source code for qtmqtt
git://code.qt.io/qt/qtmqtt.gitI located qtmqtt below all gt5 source (qt5>qtmqtt)
I followed below stelp
$ perl init-repository
$ configure -developer-build -opensource -nomake examples -nomake tests
$ mingw32-makeWhen I check Makefile
It seems it's not include qtmqtt moduleIs there any way to include qtmqtt submodule when I build whole source??
or I want to buile qtmqtt itself.
but I don't know how to build it .Any helps..
Thanks~ -
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.
-
@JungJIhyun said in qtmqtt build on windows:
$ mingw32-make
and don't forget to
mingw32-make install
-
Thanks for the your help.
When I try qtmqtt build using mingw32-make below errors are comeC:\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 -
@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.)? -
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
-
If you did nothing special, then you have the dev branch checked out. Switch the the branch matching your Qt version.
-
@SGaist Thank you for your fast reply, how can I do that?
-
Using
git checkout <name of the branch/tag>
-
This post is deleted! -
@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
-
Did you cleanup before restarting the build ?
-
What do you mean with cleanup?
-
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
- MakeFile
-
@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.
-
@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 -
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 ? -
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.