QT5.2.1 :-1: error: Unknown module(s) in QT: serialport
-
wrote on 24 Apr 2015, 18:22 last edited by
On which OS are you working? Under Ubuntu you have to install the Qt serialport package.
-
On which OS are you working? Under Ubuntu you have to install the Qt serialport package.
wrote on 27 Apr 2015, 07:27 last edited by wowy@cybercatalyst
I am working on ubuntu 14.04.I tried getting the source ( https://wiki.qt.io/Qt_Serial_Port#Getting_the_source_code ) but i always had the error :
fatal: unable to connect to code.qt.io:
code.qt.io[0: 54.77.201.214]: errno=Connection timed outIs there any other way to download them ?
EDIT : I downloaded it here :
https://qt.gitorious.org/qt/qtserialport/source/da396bc54b776da682ffdcd2aa61f504d607bc12:I tried to follow the qtcreator instruction from here :
https://wiki.qt.io/Qt_Serial_Port#Build_and_install_from_QtCreatorI added install argument to my make and then tried to rebuild the project but i have a issue :
/home/spi/Bureau/qtserialport/qt-qtserialport/src/serialport/qserialport.h:40: error: QtSerialPort/qserialportglobal.h: No such file or directory
I checked, the file is in the project and in the src folder.
-
Hi @wowy ,
I checked in the installation folder of qt5.2.1
- What is the full path to your installation folder?
- How did you install Qt 5.2.1?
If you installed it from the Ubuntu repositories, install Qt Serial Port from the Ubuntu Software Center (libqt5serialport5-dev).
I tried getting the source ( https://wiki.qt.io/Qt_Serial_Port#Getting_the_source_code )
Don't do that. There is a high risk that you will end up with multiple copies of the library in your computer, and you will have a hard time debugging if your program links to the wrong version.
Delete all the source code you downloaded and any binaries you built yourself. Use the official installers.
-
Hi @wowy ,
I checked in the installation folder of qt5.2.1
- What is the full path to your installation folder?
- How did you install Qt 5.2.1?
If you installed it from the Ubuntu repositories, install Qt Serial Port from the Ubuntu Software Center (libqt5serialport5-dev).
I tried getting the source ( https://wiki.qt.io/Qt_Serial_Port#Getting_the_source_code )
Don't do that. There is a high risk that you will end up with multiple copies of the library in your computer, and you will have a hard time debugging if your program links to the wrong version.
Delete all the source code you downloaded and any binaries you built yourself. Use the official installers.
wrote on 28 Apr 2015, 06:53 last edited by@JKSH
But if i use the install from the ubuntu software center it will only install it in the qt5 version i installed using the USC, right ?I use qt creator with a qt5 kit and a qt4 kit, i manually installed the qt4 version and i would need to use the serial port too with this version.
-
@JKSH
But if i use the install from the ubuntu software center it will only install it in the qt5 version i installed using the USC, right ?I use qt creator with a qt5 kit and a qt4 kit, i manually installed the qt4 version and i would need to use the serial port too with this version.
Hi @wowy,
Please answer the 2 questions in my previous post.
But if i use the install from the ubuntu software center it will only install it in the qt5 version i installed using the USC, right ?
Right.
I use qt creator with a qt5 kit and a qt4 kit, i manually installed the qt4 version and i would need to use the serial port too with this version.
You only asked for Qt 5 in your original post, so I gave you a Qt 5 solution. Anyway, try that first; focus on getting it working for Qt 5 first. Worry about Qt 4 later.
-
wrote on 8 Jul 2018, 02:06 last edited by
I got this problem too ! additionally, you should install libqt5serialport5-dev while libqt5serialport5 has been installed!
-
wrote on 26 Sept 2018, 14:06 last edited by
I know this topic is very old and I'm sure everyone on here has figured out a solution, but I wanted to post my solution to this problem. I did the following things for linking QSerialPort to an application using the static build of Qt 5.11.2:
- Build Qt with the -static tag. (Specifically, my configure command was this: "./configure -static -prefix ../PathToQt/ -skip webengine -skip location -skip wayland". I skipped wayland and location because they had errors when compiled against std-c++11)
- Copy "libQt5SerialPort.a" from /PathToQt/qtserialport/lib/ to your project directory
- Copy "qserialport.h", "qserialport.h", and "qserialportinfo.h" from the /PathToQt/qtserialport/src/serialport to your project directory
- Remove "QT += serialport" from your .pro file if it's there.
- Change "#include <QSerialPort>" to "#include "qserialport.h" and "#include <QSerialPortInfo>" to "#include "qserialportinfo.h" where necessary
Hope this helps!
-
I know this topic is very old and I'm sure everyone on here has figured out a solution, but I wanted to post my solution to this problem. I did the following things for linking QSerialPort to an application using the static build of Qt 5.11.2:
- Build Qt with the -static tag. (Specifically, my configure command was this: "./configure -static -prefix ../PathToQt/ -skip webengine -skip location -skip wayland". I skipped wayland and location because they had errors when compiled against std-c++11)
- Copy "libQt5SerialPort.a" from /PathToQt/qtserialport/lib/ to your project directory
- Copy "qserialport.h", "qserialport.h", and "qserialportinfo.h" from the /PathToQt/qtserialport/src/serialport to your project directory
- Remove "QT += serialport" from your .pro file if it's there.
- Change "#include <QSerialPort>" to "#include "qserialport.h" and "#include <QSerialPortInfo>" to "#include "qserialportinfo.h" where necessary
Hope this helps!
wrote on 26 Sept 2018, 14:47 last edited by@MissingNo218 I forgot to add: You also have to add "LIBS += libQt5SerialPort.a" to your .pro file
-
wrote on 19 Aug 2022, 05:57 last edited by
sudo apt-get install build-essential
sudo apt-get install cmake qt5-default qtcreator
sudo apt-get install libqt5serialport5
sudo apt-get install libqt5serialport5-dev