Closed Trikos closed 4 years ago
Using the .pri file is not going to work. At best it will compile the QMQTT source and give you a bunch of errros regarding dll linkage (when compiling for windows).
The usual way to compile is to use qmqtt.pro in the root of the repo. You need to have perl installed to do this. After compilation deploy the project. It should install within your QT distribution. When this is done you should be able to use 'QT += qmqtt' in your own .pro file.
If this does not work out for you, please show us the compiler output.
Wow. I installed PEARL, then open the root .pro file. Select Win64x, compiled and deployed. No error at all. No the debug folder has been created. I opened my project I put qmqtt in .pro and same error. Unknow module. Maybe I had to include something or link the library in some way? Thank you for helping
This is the content of the compiled folder
The problem is probably with the 'deploy' step. I guess you're using QT creator to do this. It appears that the default deploy step does not copy any files to the QT installation directory. I had a custom one in my project, so it worked on my system.
The safest way to 'deploy' the project is to open a command prompt and go to the build directory created by qt-creator (this is the one you showed in your screenshot). Run the command nmake install
there. This should copy all project files to the QT installation directory. This is the directory where the QT itself has been installed. (By default it's c:\qt
if I'm not mistaken).
Before trying to compile your own code, please check if the files have been copied properly. Assuming your QT installation directory is c:\qt
the qmqtt headers should be present in c:\qt\5.13.2\msvc2017_64\include\QtQmqtt
.
If that is OK, you should be able to compile your own code. I tried all this with a small test project, and the first time I tried I also got the 'qmqtt.h' not found error while compiling. After restart QT creator the error mysteriously disappeared. It seems QT creator is caching some information, maybe as part of their 'kits'.
Im using qt creator. So after these steps I can also use qmqtt in android compilation right?
For android compilation you need to setup an 'kit' within qt creator to cross compile to android (to do that you probably need the android SDK and the android QT binaries). If you use win64 it will compile for windows only.
On 11-Oct-20 18:05:47, Trikos notifications@github.com wrote:
Im using qt creator. So after these steps I can also use qmqtt in android compilation right?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I tried to move on my directory but using nmake install is not recognized as internal command and I havent Linux installed. I tried to look for nmake.exe into Microsoft VC 2019 but nothing. I look into "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community". I found one here "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x86\nmake.exe"
My bad. You have to use the 'x64 Native Tools Command Prompt for VS 2019' (or whatever visual studio version you are using). That will create a command shell with the proper settings. You can find that command prompt in the 'Visual Studio 2019' folder in the start menu.
On 12-Oct-20 2:18:19, Trikos notifications@github.com wrote:
I tried to move on my directory but using nmake install is not recognized as internal command and I havent Linux installed. I tried to look for nmake.exe into Microsoft VC 2019 but nothing. I look into "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community". I found one here "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x86\nmake.exe"
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Well I did. It compiled. Let me show you what is inside the folder It seems everything ok, so I created a new project, inserted QT += qmqtt, run qmake everything fine, then moved to the main and this happened C:\Documents\mqtttest\main.cpp:5: error: 'qmqtt.h' file not found C:\Documents\mqtttest\main.cpp:13: error: use of undeclared identifier 'QMQTT' I tried to remove the kit x64, restart qt but nothing. This is my .pro
Regarding Android I have everything setted but I dont know how to move in order to compile the library and then use it. Thank you again, super helpful
The error message 'qmqtt.h' makes sense, because the QtQmqtt directory should include far more files than just QtQmqttDepends. One of them should be qmqtt.h
. So I guess the nmake install
command somehow failed.
If you try to build again in the visual studio command prompt and run nmake install
. On my system I get output like this (this is only part of the output). I guess on your system part not all copy actions are performed or they fail somehow.
Generating Code... link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /SUBSYSTEM:WINDOWS /VERSION:1.0 /MANIFEST:embed /OUT:....\lib\Qt5Qmqttd.dll @C:\Users\ejvr\AppData\Local\Temp\nm86C8.tmp Creating library ....\lib\Qt5Qmqttd.lib and object ....\lib\Qt5Qmqttd.exp copy /y ....\lib\Qt5Qmqttd.dll ....\bin 1 file(s) copied. copy /y ....\lib\Qt5Qmqttd.dll c:\qt\5.11.3\msvc2017_64\bin\Qt5Qmqttd.dll 1 file(s) copied. copy /y ....\lib\Qt5Qmqttd.pdb c:\qt\5.11.3\msvc2017_64\bin\Qt5Qmqttd.pdb 1 file(s) copied. c:\qt\5.11.3\msvc2017_64\bin\qmake.exe -install sed -e "s,C:/Users/ejvr/dev/qmqtt/.qt-pro/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\Users\\ejvr\\dev\\qmqtt\\.qt-pro\\lib,$$[QT_INSTALL_LIBS],gi" ....\lib\Qt5Qmqttd.prl > c:\qt\5.11.3\msvc2017_64\lib\Qt5Qmqttd.prl copy /y ....\lib\Qt5Qmqttd.lib c:\qt\5.11.3\msvc2017_64\lib\Qt5Qmqttd.lib 1 file(s) copied. c:\qt\5.11.3\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\ejvr\dev\qmqtt.qt-pro\include\QtQmqtt\qtqmqttversion.h c:\qt\5.11.3\msvc2017_64\include\QtQmqtt\qtqmqttversion.h
I tried multiple times but only that one file appear in my folder. I have some other inside the bin folder. When compiling I have more strings than before. Can you show me what files would be inside the folders QtQmqtt? Also is complicated to compile for Android because I will use it on Android instead of Win. Thank you
I tried another library qt/mqtt and I did the same stuff, build for WIN then using the tool compiled with nmake install and on the cmd more stuff appear, like real building stuff. If I sent here my log could be helpful?
`Microsoft (R) Program Maintenance Utility Version 14.27.29112.0 Copyright (C) Microsoft Corporation. All rights reserved.
cd src\ && ( if not exist Makefile C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -o Makefile C:\Users\sk8te\Downloads\qmqtt-master\qmqtt-master\src\src.pro -spec win32-msvc "CONFIG+=qtquickcompiler" ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe" -f Makefile install
Microsoft (R) Program Maintenance Utility Version 14.27.29112.0 Copyright (C) Microsoft Corporation. All rights reserved.
cd mqtt\ && ( if not exist Makefile.qmqtt C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -o Makefile.qmqtt C:\Users\sk8te\Downloads\qmqtt-master\qmqtt-master\src\mqtt\qmqtt.pro -spec win32-msvc "CONFIG+=qtquickcompiler" ) && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe" -f Makefile.qmqtt install
Microsoft (R) Program Maintenance Utility Version 14.27.29112.0 Copyright (C) Microsoft Corporation. All rights reserved.
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe" -f Makefile.qmqtt.Release install
Microsoft (R) Program Maintenance Utility Version 14.27.29112.0 Copyright (C) Microsoft Corporation. All rights reserved.
copy /y ..\..\lib\Qt5Qmqtt.dll C:\Qt\5.13.2\msvc2017_64\bin\Qt5Qmqtt.dll
1 file(s) copied.
copy /y ..\..\lib\Qt5Qmqtt.pdb C:\Qt\5.13.2\msvc2017_64\bin\Qt5Qmqtt.pdb
1 file(s) copied.
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install sed -e "s,C:/Users/sk8te/Downloads/qmqtt-master/build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Users\\\\sk8te\\\\Downloads\\\\qmqtt-master\\\\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,C:/Qt/5.13.2/msvc2017_64/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Qt\\\\5.13.2\\\\msvc2017_64\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\lib\Qt5Qmqtt.prl > C:\Qt\5.13.2\msvc2017_64\lib\Qt5Qmqtt.prl
copy /y ..\..\lib\Qt5Qmqtt.lib C:\Qt\5.13.2\msvc2017_64\lib\Qt5Qmqtt.lib
1 file(s) copied.
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\include\QtQmqtt\QtQmqttDepends C:\Qt\5.13.2\msvc2017_64\include\QtQmqtt\QtQmqttDepends
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\mkspecs\modules-inst\qt_lib_qmqtt.pri C:\Qt\5.13.2\msvc2017_64\mkspecs\modules\qt_lib_qmqtt.pri
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\mkspecs\modules-inst\qt_lib_qmqtt_private.pri C:\Qt\5.13.2\msvc2017_64\mkspecs\modules\qt_lib_qmqtt_private.pri
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\lib\cmake\Qt5Qmqtt\Qt5QmqttConfig.cmake C:\Qt\5.13.2\msvc2017_64\lib\cmake\Qt5Qmqtt\Qt5QmqttConfig.cmake
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\lib\cmake\Qt5Qmqtt\Qt5QmqttConfigVersion.cmake C:\Qt\5.13.2\msvc2017_64\lib\cmake\Qt5Qmqtt\Qt5QmqttConfigVersion.cmake
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\nmake.exe" -f Makefile.qmqtt.Debug install
Microsoft (R) Program Maintenance Utility Version 14.27.29112.0 Copyright (C) Microsoft Corporation. All rights reserved.
copy /y ..\..\lib\Qt5Qmqttd.dll C:\Qt\5.13.2\msvc2017_64\bin\Qt5Qmqttd.dll
1 file(s) copied.
copy /y ..\..\lib\Qt5Qmqttd.pdb C:\Qt\5.13.2\msvc2017_64\bin\Qt5Qmqttd.pdb
1 file(s) copied.
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install sed -e "s,C:/Users/sk8te/Downloads/qmqtt-master/build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Users\\\\sk8te\\\\Downloads\\\\qmqtt-master\\\\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,C:/Qt/5.13.2/msvc2017_64/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Qt\\\\5.13.2\\\\msvc2017_64\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\lib\Qt5Qmqttd.prl > C:\Qt\5.13.2\msvc2017_64\lib\Qt5Qmqttd.prl
copy /y ..\..\lib\Qt5Qmqttd.lib C:\Qt\5.13.2\msvc2017_64\lib\Qt5Qmqttd.lib
1 file(s) copied.
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\include\QtQmqtt\QtQmqttDepends C:\Qt\5.13.2\msvc2017_64\include\QtQmqtt\QtQmqttDepends
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\mkspecs\modules-inst\qt_lib_qmqtt.pri C:\Qt\5.13.2\msvc2017_64\mkspecs\modules\qt_lib_qmqtt.pri
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\mkspecs\modules-inst\qt_lib_qmqtt_private.pri C:\Qt\5.13.2\msvc2017_64\mkspecs\modules\qt_lib_qmqtt_private.pri
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\lib\cmake\Qt5Qmqtt\Qt5QmqttConfig.cmake C:\Qt\5.13.2\msvc2017_64\lib\cmake\Qt5Qmqtt\Qt5QmqttConfig.cmake
C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall C:\Users\sk8te\Downloads\qmqtt-master\build-qmqtt-Desktop_Qt_5_13_2_MSVC2017_64bit-Release\lib\cmake\Qt5Qmqtt\Qt5QmqttConfigVersion.cmake C:\Qt\5.13.2\msvc2017_64\lib\cmake\Qt5Qmqtt\Qt5QmqttConfigVersion.cmake`
Judging from your logs it looks like all necessary files have been installed except the headers. I have no idea why, but on your system the C:\Qt\5.13.2\msvc2017_64\bin\qmake.exe -install qinstall ...
commands that should copy the headers have been skipped.
The files in c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt
are:
qmqtt.h
qmqtt_client.h
qmqtt_frame.h
qmqtt_global.h
qmqtt_message.h
qmqtt_networkinterface.h
qmqtt_routedmessage.h
qmqtt_router.h
qmqtt_routesubscription.h
qmqtt_socketinterface.h
qmqtt_timerinterface.h
QtQmqtt
QtQmqttDepends
QtQmqttVersion
qtqmqttversion.h
Inside this directory there's also a subdirectory 1.0.0\QtQmqtt\private
, which contains the files:
qmqtt_client_p.h
qmqtt_message_p.h
qmqtt_network_p.h
qmqtt_socket_p.h
qmqtt_ssl_socket_p.h
qmqtt_timer_p.h
qmqtt_websocket_p.h
qmqtt_websocketiodevice_p.h
This is my installation log file (release only):
Creating library c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.lib and object c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.exp
copy /y c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.dll c:\dev\qmqtt\.qt-win\bin
1 file(s) copied.
copy /y c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.dll c:\Qt\5.15.1\msvc2019_64\bin\Qt5Qmqtt.dll
1 file(s) copied.
copy /y c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.pdb c:\Qt\5.15.1\msvc2019_64\bin\Qt5Qmqtt.pdb
1 file(s) copied.
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install sed -e "s,C:/Users/ernst/dev/qmqtt/.qt-win/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Users\\\\ernst\\\\dev\\\\qmqtt\\\\.qt-win\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,D:/Users/ej/extern/Qt/5.15.1/msvc2019_64/lib,$$[QT_INSTALL_LIBS],g" -e "s,D:\\\\Users\\\\ej\\\\extern\\\\Qt\\\\5.15.1\\\\msvc2019_64\\\\lib,$$[QT_INSTALL_LIBS],gi" c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.prl > c:\Qt\5.15.1\msvc2019_64\lib\Qt5Qmqtt.prl
copy /y c:\dev\qmqtt\.qt-win\lib\Qt5Qmqtt.lib c:\Qt\5.15.1\msvc2019_64\lib\Qt5Qmqtt.lib
1 file(s) copied.
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\include\QtQmqtt\qtqmqttversion.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qtqmqttversion.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\include\QtQmqtt\QtQmqttVersion c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\QtQmqttVersion
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\include\QtQmqtt\QtQmqtt c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\QtQmqtt
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_client.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_client.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_frame.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_frame.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_global.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_global.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_message.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_message.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_networkinterface.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_networkinterface.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_routedmessage.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_routedmessage.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_router.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_router.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_routesubscription.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_routesubscription.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_socketinterface.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_socketinterface.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_timerinterface.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\qmqtt_timerinterface.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\include\QtQmqtt\QtQmqttDepends c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\QtQmqttDepends
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_client_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_client_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_message_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_message_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_network_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_network_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_socket_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_socket_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_ssl_socket_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_ssl_socket_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_timer_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_timer_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_websocket_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_websocket_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\src\mqtt\qmqtt_websocketiodevice_p.h c:\Qt\5.15.1\msvc2019_64\include\QtQmqtt\1.0.0\QtQmqtt\private\qmqtt_websocketiodevice_p.h
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\mkspecs\modules-inst\qt_lib_qmqtt.pri c:\Qt\5.15.1\msvc2019_64\mkspecs\modules\qt_lib_qmqtt.pri
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\mkspecs\modules-inst\qt_lib_qmqtt_private.pri c:\Qt\5.15.1\msvc2019_64\mkspecs\modules\qt_lib_qmqtt_private.pri
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\lib\cmake\Qt5Qmqtt\Qt5QmqttConfig.cmake c:\Qt\5.15.1\msvc2019_64\lib\cmake\Qt5Qmqtt\Qt5QmqttConfig.cmake
c:\Qt\5.15.1\msvc2019_64\bin\qmake.exe -install qinstall c:\dev\qmqtt\.qt-win\lib\cmake\Qt5Qmqtt\Qt5QmqttConfigVersion.cmake c:\Qt\5.15.1\msvc2019_64\lib\cmake\Qt5Qmqtt\Qt5QmqttConfigVersion.cmake
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\nmake.exe" -f Makefile.qmqtt.Debug install
I match the logs and something missing I dont know why. So I tried to follow another path: i imported some headers directly in my project Then I included the library that a friend told me to use inside my main.cpp but Im not sure they are sufficient and then I tried to create inside my main.cpp a Client, subscribe to HIVE broker and publish a message
No message received but all the stuff worked compiled on Android Studio. There is a wiki in order to use it correctly? Or can you guide me to an example of sending and listening (my main concern is publish some messages, actually I dont need to listen for them) Thank you again
We have a small example project in the repo: https://github.com/emqx/qmqtt/tree/master/examples/qmqtt/client
I can't find anything wrong with your code except:
Client::connected
signal has been fired.QCoreApplication
object (or something that inherits from it) and call exec()
function at the end of the main function.You can find all of this in the example project.
Ok Im checking the example. About your last point I create at the begin this object QApplication app(argc, argv); and at the end of my main.cpp return app.exec(); Is this ok or I have to use QCoreApplication? I use QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); at the first line of my main and then never again
I tried the example but on compilation I get these errors:
F:\QT\SecsyApp\qmqtt\examples\qmqtt\build-client-Desktop_Qt_5_13_2_MSVC2017_32bit-Debug\.moc\debug\moc_qmqtt_router.cpp:66: error: C2491: 'QMQTT::Router::staticMetaObject': definition of dllimport static data member not allowed
F:\QT\SecsyApp\qmqtt\examples\qmqtt\build-client-Desktop_Qt_5_13_2_MSVC2017_32bit-Debug\.moc\debug\moc_qmqtt_routesubscription.cpp:100: error: C2491: 'QMQTT::RouteSubscription::staticMetaObject': definition of dllimport static data member not allowed
F:\QT\SecsyApp\qmqtt\examples\qmqtt\build-client-Desktop_Qt_5_13_2_MSVC2017_32bit-Debug\.moc\debug\moc_qmqtt_socketinterface.cpp:124: error: C2491: 'QMQTT::SocketInterface::staticMetaObject': definition of dllimport static data member not allowed
F:\QT\SecsyApp\qmqtt\examples\qmqtt\build-client-Desktop_Qt_5_13_2_MSVC2017_32bit-Debug\.moc\debug\moc_qmqtt_networkinterface.cpp:164: error: C2491: 'QMQTT::NetworkInterface::staticMetaObject': definition of dllimport static data member not allowed
F:\QT\SecsyApp\qmqtt\examples\qmqtt\build-client-Desktop_Qt_5_13_2_MSVC2017_32bit-Debug\.moc\debug\moc_qmqtt_client.cpp:433: error: C2491: 'QMQTT::Client::staticMetaObject': definition of dllimport static data member not allowed
F:\QT\SecsyApp\qmqtt\examples\qmqtt\build-client-Desktop_Qt_5_13_2_MSVC2017_32bit-Debug\.moc\debug\moc_qmqtt_timerinterface.cpp:88: error: C2491: 'QMQTT::TimerInterface::staticMetaObject': definition of dllimport static data member not allowed
I tried to comment out the whole code but these errors appear anyway. Inconsistent dll linkage
Is this ok or I have to use QCoreApplication?
Yes, QApplication
should work, because the class inherits QCoreApplication
.
About the dll linkage errors: it seems you are compiling qmqtt itself, not the example. This should work, but apparently it does not on your system. You can work around it by opening example.pro in QT creator, which allows you to compile the example only.
Any news here or may we close this?
I would close the issue. We can always reopen it. It seems to be a problem in a single system.
On 08-Nov-20 10:05:13, Matthias Dieter Wallnöfer notifications@github.com wrote:
Any news here or may we close this?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi @mwallnoefer
I have the same problem. I can compile running:
qmake
make
make install
but in the C:\Qt\6.2.3\mingw_64\include\QtQmqtt
I find only the QtQmqttDepends
file and my Qt project cannot find "qmqtt.h" header.
Also, running make all
it fails in compiling the examples because It couldn't find the qmqtt.h
file.
SO: Windows10 Qt: 6.2.3 qmake: 3.1 mingw32-make: 4.2.1
How can I solve the problem?
thanks
Please consider issue #221 (in detail ejvr's answer: https://github.com/emqx/qmqtt/issues/221#issuecomment-803454316). If it doesn't help let us continue the discussion there.
thanks @mwallnoefer for the answer.
I copied all the header files that @ejvr pointed out here (just few comments above) and now I can compile, run, connect and push to a mosquitto broker successfully.
Now I have to repeat the procedure on another computer...
Is there something that I can change in the Cmakefile or somewhere else in order to make it work properly?
thanks again
I guess if @ejvr does not answer we cannot do much about it. Please consider qmqtt
as semi-abandonware: it isn't developed any further, we just accept bug-fixes but no new features.
I don't have a lot info to add here. Normally, I would check the output of the make install
to find out if qmqtt.h
was copied and to which location.
Hi, Im trying to use your library but I cant compile. Can you help me? I tried to download the source code and using include(path/to/.pri) into my project without doing nothing and QT said unknown qmqtt module found. I tried to open the qmqtt-master/src/qmqtt.pro and compile for winx64 and I get some error during compilation (I set CONFIG += QMQTT_NO_SSL; CONFIG += NO_UNIT_TESTS) What can I do in order to use it? Im developing an Android app and I want to insert this mqtt inside it. Thank you