Solved How to use serial port in qt 6.2?
-
I'm learning to use Qt. I'm using Qt 6.2 to make an application with Arduino.
I made the include
#include <QSerialPort>
and
QT += serialport
But I didn't understand that part.
find_package(Qt6 COMPONENTS SerialPort REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::SerialPort)When I try to compile, I get an error that it can't be found.
QSerialPort not found
-
@Christian-Ehrlicher QSerialPort was not in 6.0 but it is in 6.2
https://doc.qt.io/qt-6.2/whatsnew62.html
If you are installing with the MaintenanceTool, Qt Serial Port is an optional component under "Additional Libraries" -
Because Qt6.2 has no QtSerialPort yet - use Qt6.3: https://forum.qt.io/topic/122548/serial-port-for-qt-6
-
@Christian-Ehrlicher QSerialPort was not in 6.0 but it is in 6.2
https://doc.qt.io/qt-6.2/whatsnew62.html
If you are installing with the MaintenanceTool, Qt Serial Port is an optional component under "Additional Libraries" -
@bee65 Yeah solve the problem. Thank you!