QT unknown module serial port
-
Hello. I have just downloaded a trial version QT on Windows 10 operating system. I have followed default installation steps and selected the following options for my installation:
Design Tools
QT 6.3 for desktop development
QT 6.3 for embedded development
MCU developmentAfter installation, I have created a simple qt widget application, selected qmake and added qtwidget class.
I would like to send some serial data to connected serial device. I have added QT += serialport to my .pro file
QT += core gui QT += serialport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h FORMS += \ widget.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target
However, I can not build the project succesfully as the serial port is not recognised.
09:40:27: Configuration unchanged, skipping qmake step. 09:40:27: Starting: "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" -j16 C:\Qt\6.3.1\mingw_64\bin\qmake.exe -o Makefile ..\UTB_gui\UTB_gui.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" Project ERROR: Unknown module(s) in QT: serialport mingw32-make: *** [Makefile:223: Makefile] Error 3 09:40:28: The process "C:\Qt\Tools\mingw1120_64\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project UTB_gui (kit: Desktop Qt 6.3.1 MinGW 64-bit) When executing step "Make" 09:40:28: Elapsed time: 00:01.
Could you clarify the following:
- Do I need to manually download different modules?
- If yes to above, could you clarify how can this be done and how to import the downloaded modules such as serialport
- If no, can you clarify how can I get the required modules?
-
@lukutis222 see this topic for all the answers you seek:
https://forum.qt.io/topic/138060/uknown-module-s-in-qr-serialport
-
Thank you for your fast response. Unfortunately, it is still not clear for me. How do I open this window?
By the way, I have installed qt using online installer
-
@lukutis222 said in QT unknown module serial port:
By the way, I have installed qt using online installer
Then open Qt Maintenance Tool (its executable is in your Qt installation folder) and select this module there.
-
I couldn't find QSerialPort in qt 6.7.2 under Qt Maintenance Tool. Kindly help
-
@AnushaDevi look closer, it is there.
Maybe you'll have to check the Archive checkbox, since 6.7.3 is released it doesn't display it by default any longer for 6.7.2
In fact 6.7.2 is only shown at all when you have something installed from it already, or the Archive checkbox checked.
-
-
For open source user the Qt Company only provides complete prebuilt library binaries for the latest released version in the current series; in this case 6.7.3. For the preceding series, i.e 5.15, only the latest available at the time Qt 6 released remains available. The source code for Qt 6.7.2 remains available, and you could build your own serial submodule if you wish.
Commercial licensees have more options. -
@AnushaDevi click the filter button after checking the checkbox. That will trigger a download and update of the selection tree