PDA

View Full Version : Problems when adding serialport module in Qt project



Cazzaniga
13th June 2018, 08:49
Hi,
I need to use QSerialport in my Qt project. Following the official documentation, I added
QT += serialport to my .pro file. After doing this, the build always fails, giving the error: "Unknown module(s) in QT: serialport". I am using Qt Creator 4.1.0 based on Qt 5.6.1. What am I missing?
Thank you.

high_flyer
13th June 2018, 11:02
try installing qt5-qtserialport-devel with your favorite package manager (I assume you are on linux based on your profile information)

Cazzaniga
13th June 2018, 11:27
Hi high_flyer,
my develop PC runs Ubuntu 16.04. Is it possible I cannot find the package you suggested?
How can I make sure which Qt version am I using in my project?
Thank you.

Ginsengelf
13th June 2018, 15:41
Hi, according to packages.ubuntu.com (https://packages.ubuntu.com/source/xenial/qtserialport-opensource-src) the package is called libqt5serialport5 and libqt5serialport5-dev.

Ginsengelf

Cazzaniga
14th June 2018, 09:55
Since I need to cross-compile for my device running linux Yocto, is there a different way to include the serial port module in my Qt project? Are the drivers/libraries different?
Thanks.

high_flyer
14th June 2018, 11:08
I don't understand.
Yocto is not a distro - its a packaging tool, a distro maker if you will.

If you are cross compiling you will need a cross compiled version of Qt as well.
The serial port module is available on all Qt supported platform *I think* - but the docs can probably help.