error: Unknown module(s) in QT: mqtt
-
I'm trying to use the mqtt module, but when I write QT += mqtt in the .pro file, I get the error: error: Unknown module(s) in QT: mqtt.
I searched for the mqtt module in the Maintenance Tool, but it's not listed. Isn't mqtt a standard module included with Qt? What's the problem?
I'm using Qt 6.10.1 with C++. Compiling on Windows using qmake/msvc
-
Here is solution:
- create mqtt directory
- run "git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1" in this directory
- open qtmqtt directory and create build folder in it
- open "X64 native tools command prompt for VS 2022" in build folder and run following commands:
To build Release version:
cmake -S .. -B build -G "Ninja" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
cmake --build build --config Release
cmake --install buildTo build Debug version:
cmake -S .. -B build -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
cmake --build build --config Debug
cmake --install build --config Debug -
I'm trying to use the mqtt module, but when I write QT += mqtt in the .pro file, I get the error: error: Unknown module(s) in QT: mqtt.
I searched for the mqtt module in the Maintenance Tool, but it's not listed. Isn't mqtt a standard module included with Qt? What's the problem?
I'm using Qt 6.10.1 with C++. Compiling on Windows using qmake/msvc
-
@jsulm It also available under GPL https://doc.qt.io/qt-6/qtmqtt-index.html
I compiled the project using the following commands:
git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1
and then from build directory:
cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
cmake --build build --config Release
cmake --install buildBut this builds the mqtt module for release. I tried building it for debug, but it still only builds for release. How do I build it for debug version?
-
@jsulm It also available under GPL https://doc.qt.io/qt-6/qtmqtt-index.html
I compiled the project using the following commands:
git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1
and then from build directory:
cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
cmake --build build --config Release
cmake --install buildBut this builds the mqtt module for release. I tried building it for debug, but it still only builds for release. How do I build it for debug version?
@Jo-Jo said in error: Unknown module(s) in QT: mqtt:
I tried building it for debug
In a fresh build folder?
-
@jsulm said in error: Unknown module(s) in QT: mqtt:
@Jo-Jo How exactly do you build for debug?
cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
cmake --build build --config Debug
cmake --install buildand after cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
I see following output:
...
-- Setting build type to 'Release' as none was specified.It does not recognize debug mode
-
@jsulm It also available under GPL https://doc.qt.io/qt-6/qtmqtt-index.html
I compiled the project using the following commands:
git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1
and then from build directory:
cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
cmake --build build --config Release
cmake --install buildBut this builds the mqtt module for release. I tried building it for debug, but it still only builds for release. How do I build it for debug version?
-
@jsulm said in error: Unknown module(s) in QT: mqtt:
@Jo-Jo How exactly do you build for debug?
cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
cmake --build build --config Debug
cmake --install buildand after cmake -S .. -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64"
I see following output:
...
-- Setting build type to 'Release' as none was specified.It does not recognize debug mode
@Jo-Jo Hi,
If you have
ccmakeyou can check visually what is configured to find out what is happening.@JoeCFD said in error: Unknown module(s) in QT: mqtt:
@Jo-Jo I guess you built only Qt module for using mqtt.
Mqtt needs to be installed separately. Check the following out:
https://mosquitto.org/download/It's unrelated to the problem at hand. @Jo-Jo wants to use/build the QtMQTT module.
-
Here is solution:
- create mqtt directory
- run "git clone git://code.qt.io/qt/qtmqtt.git -b 6.10.1" in this directory
- open qtmqtt directory and create build folder in it
- open "X64 native tools command prompt for VS 2022" in build folder and run following commands:
To build Release version:
cmake -S .. -B build -G "Ninja" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
cmake --build build --config Release
cmake --install buildTo build Debug version:
cmake -S .. -B build -G "Ninja Multi-Config" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -DCMAKE_PREFIX_PATH="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_INSTALL_PREFIX="C:\Qt\6.10.1\msvc2022_64" -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
cmake --build build --config Debug
cmake --install build --config Debug -
J Jo Jo has marked this topic as solved on