Ошибка qserialport file not found

I use this tutorial : http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html

But when I want to run it Qt Creator generates the following error:

error: Unknown module(s) in QT: serialport

When I hold mouse on #include <QtSerialPort/QSerialPort> it says:

include no such file or directory

I use Qt 5.0.1 any idea?

MrLeeh's user avatar

MrLeeh

5,2716 gold badges32 silver badges50 bronze badges

asked Jun 20, 2013 at 6:02

Mahdi_Nine's user avatar

Mahdi_NineMahdi_Nine

14.1k26 gold badges82 silver badges117 bronze badges

1

Try including #include <QtSerialPort/QSerialPort> instead of
#include <QSerialPort>, that worked for me

eyllanesc's user avatar

eyllanesc

233k19 gold badges166 silver badges238 bronze badges

answered May 8, 2018 at 9:03

Stefano Zuinisi's user avatar

try including

#include <QtSerialPort/QSerialPort>

also update your project.pro file, add this flag

QT += serialport

after that clean , qmake , rebuild the project

answered Jan 14, 2020 at 13:15

user889030's user avatar

user889030user889030

4,2833 gold badges47 silver badges51 bronze badges

2

I use this tutorial : http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html

But when I want to run it Qt Creator generates the following error:

error: Unknown module(s) in QT: serialport

When I hold mouse on #include <QtSerialPort/QSerialPort> it says:

include no such file or directory

I use Qt 5.0.1 any idea?

MrLeeh's user avatar

MrLeeh

5,2716 gold badges32 silver badges50 bronze badges

asked Jun 20, 2013 at 6:02

Mahdi_Nine's user avatar

Mahdi_NineMahdi_Nine

14.1k26 gold badges82 silver badges117 bronze badges

1

Try including #include <QtSerialPort/QSerialPort> instead of
#include <QSerialPort>, that worked for me

eyllanesc's user avatar

eyllanesc

233k19 gold badges166 silver badges238 bronze badges

answered May 8, 2018 at 9:03

Stefano Zuinisi's user avatar

try including

#include <QtSerialPort/QSerialPort>

also update your project.pro file, add this flag

QT += serialport

after that clean , qmake , rebuild the project

answered Jan 14, 2020 at 13:15

user889030's user avatar

user889030user889030

4,2833 gold badges47 silver badges51 bronze badges

2

  • #1

Hi All,
I’m not sure if this is posted in the correct location. OP please move if not.

Maybe someone with QT knowledge could help me out. I am attempting to build a Amateur Radio QT application called DroidStar on FreeBSD 13.0. The code is C++ and it builds fine until it reaches this header. Does anyone know where this header and lib is? I have pkg install qt5-serialport so that package is installed but it doesn’t seem to have the library header that the code is requesting. This code was built on Linux but I am wanting to port it to FreeBSD however I need to just do a normal build before I attempt a port. Below is the error I am seeing. It seems like it would be a simple fix if I could find the header and lib that it’s wanting.
This code was built on Linux but I am wanting to port it to FreeBSD however I need to just do a normal build before I attempt a port.

C++:

../../DroidStar/serialambe.h:22:10: fatal error: 'QSerialPort' file not found
#include <QSerialPort>
         ^~~~~~~~~~~~~
1 error generated.
*** Error code 1

The source can be found at https://github.com/nostar/DroidStar

SirDice


  • #2

You probably forgot to add

/usr/local/include

(include path) and

/usr/local/lib

(library path). Those are not included by default, thus not searched.

You are the OP.

en.wikipedia.org

  • Thread Starter

  • #3

I will take a look at this. It’s not my code but I can see that as a thing since there is a difference in hier between Linux and Freebsd

SirDice


  • #4

On Linux it’s normal to dump the files in

/usr/include

and

/usr/lib

, those directories are included by default with the compilers. On FreeBSD however ports/packages always install with a

/usr/local

prefix, so those libraries and include files are kept in

/usr/local/include

and

/usr/local/lib

. That’s a common issue when porting code from Linux to FreeBSD, you always have to add -I/usr/local/include and -L/usr/local/lib.

  • Thread Starter

  • #5

I will take a look at this. It’s not my code but I can see that as a thing since there is a difference in hier between Linux and Freebsd

Okay so looking at the make file I am seeing the following for includes and libs

C++:

INCPATH       = -I../../DroidStar -I. -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtQuickControls2 -I/usr/local/include/qt5/QtQuick -I/usr/local/include/qt5/QtMultimedia -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtQmlModels -I/usr/local/include/qt5/QtQml -I/usr/local/include/qt5/QtNetwork -I/usr/local/include/qt5/QtCore -I. -I/usr/local/include -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang
...
LIBS          = $(SUBLIBS) -L/usr/local/lib -limbe_vocoder -ldl /usr/local/lib/qt5/libQt5QuickControls2.so /usr/local/lib/qt5/libQt5Quick.so /usr/local/lib/qt5/libQt5Multimedia.so /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5QmlModels.so /usr/local/lib/qt5/libQt5Qml.so /usr/local/lib/qt5/libQt5Network.so /usr/local/lib/qt5/libQt5Core.so -lGL

Unlike the other libs I don’t see the Serial lib spelled out in the generated Makefile for the LIBS and INCPATH directive. The few lines of instruction have you do a qmake to generate the Makefile stash. This Makefile is very long and somewhat complex. I will try compiling this on my linux box. This code is fairly new.

SirDice


  • #6

Ok, those paths, at first glance, look good.

Look at the output from pkg info -l qt5-serialport. That port has the include file and the library, take note of the paths of the files. It appears to be in a sub-directory of

/usr/local/include/qt5

and that directory isn’t in the INCPATH. Try adding -I/usr/local/include/qt5/QtSerialPort to INCPATH, see if that helps.

  • Thread Starter

  • #7

Hi SirDice, Yep that worked awesome. I also had to add the /usr/local/lib/qt5/libQt5SerialPort.so to the LIBS line but it built and actually I was able to run it on FreeBSD 13. Thank you so much for your help SirDice … I figured it was something simple like this. I have to do some more testing but my goal is to build a port/pkg for this. I attempted to build ports before but not with much success since figuring out how to compile the code is hard enough but to figure out the make file for the port is pretty involved. I know and can read Makefiles but I guess I just don’t know them well enough.. Anyway thanks for your help you’re awesome :) I wonder why qmake didn’t put these in the Makefile? :-/

Does anyone have a good template for a Makefile for a port that basically clones a repo, run qmake then make and make install? It’s been a while since I attempted to build a port. The last time didn’t go so well. I get totally lost in the FreeBSD Porters Handbook.

  • #8

The .pro file has the line linux:QT += serialport thats why the headers and library aren’t being added.

Should work if you add unix:QT += serialport

  • Thread Starter

  • #9

Thank you Criosphinx that works too. I will see if I can submit a pull request to the project now :)

Предисловие:

СсылкаБлог Bing NuoyingПосле поиска проблемы, проблема не может быть решена, и метод решения проблемы файла «QserialPort», не найденного в Интернете, одинаков. Позвольте мне поговорить о моем решении ниже

Решение:

1. Используйте инструмент Qtchooser для изменения номера версии QT по умолчанию:

Введите терминал в терминале, чтобы просмотреть номер версии QT:

qmake -v

Я нашел версию QT4 по умолчанию и загрузил QT 5.12.9.
Это объясняет, почему Qserialport не может быть найдена, потому что Qserialport становится частью QT после версии 5.1, в противном случае он должен быть вручную добавить QserialPort.

Выполните следующий код, чтобы добавить QT5.12.9

qtchooser -install qt5.12.9 /opt/qt-5.12.9-arm/bin/qmake

Проверьте, успешно ли это

qtchooser -l


Успешно обнаружил в нем QT5.12.9.

2. Выберите QT5.12.9 в QT Creator

Выберите конструкцию и работу в Tool-> Construction Kit (Kit)-> Настройки ручного управления-> Desktop (по умолчанию)-> QT-версия

Выберите QT 5.12.9 в версии QT

Перейти к контенту

I use this tutorial : http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html

But when I want to run it Qt Creator generates the following error:

error: Unknown module(s) in QT: serialport

When I hold mouse on #include <QtSerialPort/QSerialPort> it says:

include no such file or directory

I use Qt 5.0.1 any idea?

MrLeeh's user avatar

MrLeeh

5,0915 gold badges32 silver badges49 bronze badges

asked Jun 20, 2013 at 6:02

Mahdi_Nine's user avatar

Mahdi_NineMahdi_Nine

13.9k26 gold badges82 silver badges117 bronze badges

1

Try including #include <QtSerialPort/QSerialPort> instead of
#include <QSerialPort>, that worked for me

eyllanesc's user avatar

eyllanesc

230k18 gold badges147 silver badges217 bronze badges

answered May 8, 2018 at 9:03

Stefano Zuinisi's user avatar

try including

#include <QtSerialPort/QSerialPort>

also update your project.pro file, add this flag

QT += serialport

after that clean , qmake , rebuild the project

answered Jan 14, 2020 at 13:15

user889030's user avatar

user889030user889030

4,0993 gold badges45 silver badges51 bronze badges

2

  • #1

Hi All,
I’m not sure if this is posted in the correct location. OP please move if not.

Maybe someone with QT knowledge could help me out. I am attempting to build a Amateur Radio QT application called DroidStar on FreeBSD 13.0. The code is C++ and it builds fine until it reaches this header. Does anyone know where this header and lib is? I have pkg install qt5-serialport so that package is installed but it doesn’t seem to have the library header that the code is requesting. This code was built on Linux but I am wanting to port it to FreeBSD however I need to just do a normal build before I attempt a port. Below is the error I am seeing. It seems like it would be a simple fix if I could find the header and lib that it’s wanting.
This code was built on Linux but I am wanting to port it to FreeBSD however I need to just do a normal build before I attempt a port.

C++:

../../DroidStar/serialambe.h:22:10: fatal error: 'QSerialPort' file not found
#include <QSerialPort>
         ^~~~~~~~~~~~~
1 error generated.
*** Error code 1

The source can be found at https://github.com/nostar/DroidStar

SirDice

  • #2

You probably forgot to add

/usr/local/include

(include path) and

/usr/local/lib

(library path). Those are not included by default, thus not searched.

You are the OP.

en.wikipedia.org

  • Thread Starter

  • #3

I will take a look at this. It’s not my code but I can see that as a thing since there is a difference in hier between Linux and Freebsd

SirDice

  • #4

On Linux it’s normal to dump the files in

/usr/include

and

/usr/lib

, those directories are included by default with the compilers. On FreeBSD however ports/packages always install with a

/usr/local

prefix, so those libraries and include files are kept in

/usr/local/include

and

/usr/local/lib

. That’s a common issue when porting code from Linux to FreeBSD, you always have to add -I/usr/local/include and -L/usr/local/lib.

  • Thread Starter

  • #5

I will take a look at this. It’s not my code but I can see that as a thing since there is a difference in hier between Linux and Freebsd

Okay so looking at the make file I am seeing the following for includes and libs

C++:

INCPATH       = -I../../DroidStar -I. -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtQuickControls2 -I/usr/local/include/qt5/QtQuick -I/usr/local/include/qt5/QtMultimedia -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtQmlModels -I/usr/local/include/qt5/QtQml -I/usr/local/include/qt5/QtNetwork -I/usr/local/include/qt5/QtCore -I. -I/usr/local/include -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang
...
LIBS          = $(SUBLIBS) -L/usr/local/lib -limbe_vocoder -ldl /usr/local/lib/qt5/libQt5QuickControls2.so /usr/local/lib/qt5/libQt5Quick.so /usr/local/lib/qt5/libQt5Multimedia.so /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5QmlModels.so /usr/local/lib/qt5/libQt5Qml.so /usr/local/lib/qt5/libQt5Network.so /usr/local/lib/qt5/libQt5Core.so -lGL

Unlike the other libs I don’t see the Serial lib spelled out in the generated Makefile for the LIBS and INCPATH directive. The few lines of instruction have you do a qmake to generate the Makefile stash. This Makefile is very long and somewhat complex. I will try compiling this on my linux box. This code is fairly new.

SirDice

  • #6

Ok, those paths, at first glance, look good.

Look at the output from pkg info -l qt5-serialport. That port has the include file and the library, take note of the paths of the files. It appears to be in a sub-directory of

/usr/local/include/qt5

and that directory isn’t in the INCPATH. Try adding -I/usr/local/include/qt5/QtSerialPort to INCPATH, see if that helps.

  • Thread Starter

  • #7

Hi SirDice, Yep that worked awesome. I also had to add the /usr/local/lib/qt5/libQt5SerialPort.so to the LIBS line but it built and actually I was able to run it on FreeBSD 13. Thank you so much for your help SirDice … I figured it was something simple like this. I have to do some more testing but my goal is to build a port/pkg for this. I attempted to build ports before but not with much success since figuring out how to compile the code is hard enough but to figure out the make file for the port is pretty involved. I know and can read Makefiles but I guess I just don’t know them well enough.. Anyway thanks for your help you’re awesome I wonder why qmake didn’t put these in the Makefile?

Does anyone have a good template for a Makefile for a port that basically clones a repo, run qmake then make and make install? It’s been a while since I attempted to build a port. The last time didn’t go so well. I get totally lost in the FreeBSD Porters Handbook.

  • #8

The .pro file has the line linux:QT += serialport thats why the headers and library aren’t being added.

Should work if you add unix:QT += serialport

  • Thread Starter

  • #9

Thank you Criosphinx that works too. I will see if I can submit a pull request to the project now

wf778899

0 / 0 / 0

Регистрация: 10.07.2014

Сообщений: 11

1

22.02.2015, 00:06. Показов 5648. Ответов 8

Метки нет (Все метки)


Всем привет. Установил Qt 5.1, решил понасиловать COM-порт. Как я понимаю, с библиотекой QTSerialPort на этой версии уже нет прежних заморочек (не нужно качать библиотеку отдельно, потом строить, потом устанавливать) — всё уже установлено. Только в .pro файл добавить команду QT += serialport. И всё. Запустил простенький тест:

C++ (Qt)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
 
QT_USE_NAMESPACE
 
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
 
// Example use SerialPortInfo
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
qDebug() << "Name : " << info.portName();
qDebug() << "Description : " << info.description();
qDebug() << "Manufacturer: " << info.manufacturer();
 
// Example use SerialPort
QSerialPort serial;
serial.setPort(info);
if (serial.open(QIODevice::ReadWrite))
serial.close();
}
 
return a.exec();
}

Вроде работает — выводит в лог номер доступного порта, имя и производителя. Это всё на комплекте по умолчанию — «Desktop Qt5.1.0 MinGW 32bit». Решил я настроить комплект для статической сборки, методика такая http://sergey-starkov.blogspot… 1-dll.html. Настроил, создал проект на полученном комплекте, так же решил протестировать (с таким же кодом) — не идёт. Спотыкается уже на 3 строчке — не могёт подключить #include <QtSerialPort/QSerialPort> и всё что за ним. В логе пишет «D:ProjectsQt5StaticStaticmain.cpp:3: ошибка: QtSerialPort/QSerialPort: No such file or directory». Проверил этот комплект без использования QSerialPort — просто там окошко с кнопкой вывел — компилит нормально, exe-шник запускается без dllлок. Но почему SerialPort не подключается… Кто знает, помогите, пожалуйста!

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

0

Эксперт С++

8384 / 6146 / 615

Регистрация: 10.12.2010

Сообщений: 28,683

Записей в блоге: 30

22.02.2015, 14:11

2

Ну при статической сборке отваливаться webkit,qml, miltimedia и serialport насколько я знаю.

0

0 / 0 / 0

Регистрация: 10.07.2014

Сообщений: 11

22.02.2015, 14:17

 [ТС]

3

А, вот оно что… Жаль.

0

Эксперт С++

8384 / 6146 / 615

Регистрация: 10.12.2010

Сообщений: 28,683

Записей в блоге: 30

22.02.2015, 14:47

4

1

Поклонник Qt

314 / 210 / 41

Регистрация: 09.11.2013

Сообщений: 336

Записей в блоге: 1

22.02.2015, 14:48

5

Кстати, serialport можно вручную собрать статически и скопировать в комплект.
Будет нормально работать

0

Эксперт С++

8384 / 6146 / 615

Регистрация: 10.12.2010

Сообщений: 28,683

Записей в блоге: 30

22.02.2015, 14:51

6

CriDos, Только интересно какого он отваливается, как бы я не вижу из-за чего там такие проблемы.

0

Поклонник Qt

314 / 210 / 41

Регистрация: 09.11.2013

Сообщений: 336

Записей в блоге: 1

22.02.2015, 15:30

7

Avazart, вот этого не знаю…
Да и не пытался выяснить, это копать нужно в скриптах сборки.
Нужно было, собрал через QtC с заранее собранным статическим комплектом, скопировал результат в этот же набор, подключил, собрал приложение — работает
Ну и ладно, подумал я. Больше не поднимал этот вопрос

0

0 / 0 / 0

Регистрация: 10.07.2014

Сообщений: 11

22.02.2015, 22:26

 [ТС]

8

CriDos, вот тут поподробнее. Что куда копировали — не понял. И что за QtC? Ссылку на него можно?

Добавлено через 11 минут
Да,CriDos, и можете дать ссылку на методу статической сборки SerialPort — я нашёл только как эту радость прикрутить к Qt4х, что мне никакой пользы не дало (у меня Qt5.1).

0

8Observer8

23.02.2015, 11:16


    QSerialPort — подключение при статической сборке

Не по теме:

wf778899, вот удобная бесплатная программка для создания пары виртуальных портов: VSPE (Virtual Serial Ports Emulator)

0

Excuse me, but I think that I´m not understand you.

I did install my Qt from installer online.

I´m found the QSerialPort from the examples apps and I´m using SerialPortWriter class from cwriteasync example.

1)qmake
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ which qmake
/usr/bin/qmake

so I used:
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ /opt/Qt/5.8/gcc_64/bin/qmake PREFIX=/usr
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$

no message -> ok

2)next step is run linuxdeployqt from probonopd

luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
Not using FHS-like mode
app-binary: «/mnt/midia4/prj/qt/deploy/Controle/Controle»
appDirPath: «/mnt/midia4/prj/qt/deploy/Controle»
relativeBinPath: «Controle»
ERROR: ldd outputLine: «libQt5SerialPort.so.5 => not found»
ERROR: Please ensure that all libraries can be found by ldd. Aborting.
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$

3)Looking at /opt/Qt/5.8/gcc_64/lib

luis@hal9000:/opt/Qt/5.8/gcc_64/lib$ ldd libQt5SerialPort.so
linux-vdso.so.1 (0x00007ffd72b77000)
libQt5Core.so.5 (0x00007fef0425c000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fef0403f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fef03d34000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fef03a33000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fef0381d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fef03472000)
libicui18n.so.56 (0x00007fef02fd9000)
libicuuc.so.56 (0x00007fef02c21000)
libicudata.so.56 (0x00007fef0123e000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fef0103a000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fef00e32000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fef00c17000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fef00a15000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fef00706000)
/lib64/ld-linux-x86-64.so.2 (0x00007fef04b95000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fef00498000)
luis@hal9000:/opt/Qt/5.8/gcc_64/lib$

there is no dependency problem.

luis@hal9000:/opt/Qt/5.8/gcc_64/lib$ ls -la libQt5SerialPort.so*
lrwxrwxrwx 1 root root 25 Mai 26 2017 libQt5SerialPort.so -> libQt5SerialPort.so.5.8.0
lrwxrwxrwx 1 root root 25 Mai 26 2017 libQt5SerialPort.so.5 -> libQt5SerialPort.so.5.8.0
lrwxrwxrwx 1 root root 25 Mai 26 2017 libQt5SerialPort.so.5.8 -> libQt5SerialPort.so.5.8.0
-rwxr-xr-x 1 root root 101512 Jan 18 2017 libQt5SerialPort.so.5.8.0

this is from Qt instalation.

5)I did try follow these instructions here: https://wiki.qt.io/Qt_Serial_Port
«Build and install from QtCreator»

as root, run qtcreator and build QtSerialPort ( I think! )….because there is no errors:

08:56:18: Running steps for project serialport…
08:56:18: Starting: «/usr/bin/make» clean
cd cenumerator/ && ( test -e Makefile || /opt/Qt/5.8/gcc_64/bin/qmake -o Makefile /opt/Qt/Examples/Qt-5.8/serialport/cenumerator/cenumerator.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ) && /usr/bin/make -f Makefile clean
make[1]: Entering directory ‘/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/cenumerator’
rm -f moc_predefs.h
rm -f main.o
rm -f *~ core *.core
make[1]: Leaving directory ‘/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/cenumerator’

[there are a lot of lines here]

cd slave/ && ( test -e Makefile || /opt/Qt/5.8/gcc_64/bin/qmake -o Makefile /opt/Qt/Examples/Qt-5.8/serialport/slave/slave.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ) && /usr/bin/make -f Makefile install
make[1]: Entering directory ‘/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/slave’
install -m 755 -p slave /opt/Qt/Examples/Qt-5.8/serialport/slave/slave
make[1]: Leaving directory ‘/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/slave’
08:57:33: The process «/usr/bin/make» exited normally.
08:57:33: Elapsed time: 01:15.

6)I repeat steps (1) and (2) again

luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ /opt/Qt/5.8/gcc_64/bin/qmake PREFIX=/usr
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
Not using FHS-like mode
app-binary: «/mnt/midia4/prj/qt/deploy/Controle/Controle»
appDirPath: «/mnt/midia4/prj/qt/deploy/Controle»
relativeBinPath: «Controle»
ERROR: ldd outputLine: «libQt5SerialPort.so.5 => not found»
ERROR: Please ensure that all libraries can be found by ldd. Aborting.
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
Not using FHS-like mode
app-binary: «/mnt/midia4/prj/qt/deploy/Controle/Controle»
appDirPath: «/mnt/midia4/prj/qt/deploy/Controle»
relativeBinPath: «Controle»
ERROR: ldd outputLine: «libQt5SerialPort.so.5 => not found»
ERROR: Please ensure that all libraries can be found by ldd. Aborting.
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ /opt/Qt/5.8/gcc_64/bin/qmake PREFIX=/usr
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
Not using FHS-like mode
app-binary: «/mnt/midia4/prj/qt/deploy/Controle/Controle»
appDirPath: «/mnt/midia4/prj/qt/deploy/Controle»
relativeBinPath: «Controle»
ERROR: ldd outputLine: «libQt5SerialPort.so.5 => not found»
ERROR: Please ensure that all libraries can be found by ldd. Aborting.
luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$

These steps was ok to deploy this project until use QSerialPort.

Excuse me for these information, but like I said before I didnt understand you and i put all informations.

Я использую этот урок: http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html

Но когда я хочу запустить его Qt Creator генерирует следующую ошибку:

ошибка: неизвестный модуль (и) в QT: serialport

Когда я держу мышь на #include <QtSerialPort/QSerialPort> это говорит:

не включать такой файл или каталог

Я использую Qt 5.0.1 любая идея?

3

c++qtqt-creatorqtserialport

Решение

Модуль QtSerialPort не является частью Qt 5.0. Он был добавлен в предстоящий релиз Qt 5.1.

Вы смотрите на снимок документации для предстоящего выпуска Qt 5.1. Увидеть http://doc-snapshot.qt-project.org/qt5-stable/qtdoc/index.html.

Документация по Qt 5.0 находится здесь: http://qt-project.org/doc/qt-5.0/qtdoc/index.html.

Если вы все еще хотите попробовать QtSerialPort, RC1 из Qt 5.1 был только что выпущен. Вы можете скачать это здесь: http://download.qt-project.org/development_releases/qt/5.1/5.1.0-rc1/

2

Другие решения

Попробуйте в том числе #include <QtSerialPort/QSerialPort> вместо
#include <QSerialPort>, который работал для меня

1

Источник

I haven’t had any luck with the latest release on my newish (2018.8) DK-8-KZ so I thought I’d try to build the latest on the unix_cli_fixes branch. I’m getting «./ezgraver.h:7:10: fatal error: ‘QSerialPort’ file not found.» I tried changing the include line to QtSerialPort/QSerialPort since that header file is in a subdir of the include folder, but then I get a slew of errors:

In file included from ezgraver.cpp:1:
In file included from ./ezgraver.h:7:
In file included from /usr/local/include/QtSerialPort/QSerialPort:1:
/usr/local/include/QtSerialPort/qserialport.h:63:5: error: function-like macro ‘QT_DEPRECATED_SINCE’ is not defined
#if QT_DEPRECATED_SINCE(5, 2)
^
/usr/local/include/QtSerialPort/qserialport.h:69:5: error: function-like macro ‘QT_DEPRECATED_SINCE’ is not defined
#if QT_DEPRECATED_SINCE(5, 3)
^
/usr/local/include/QtSerialPort/qserialport.h:87:5: error: unknown type name ‘Q_FLAG’
Q_FLAG(Direction)
^
/usr/local/include/QtSerialPort/qserialport.h:87:22: error: expected ‘;’ at end of declaration list
Q_FLAG(Direction)

… etc etc, lots of the same sort of things. What are people running to lead to a successful build? I’d really like to see if the revisions since the 4.0.0-beta release will fix the non-operation of my engraver.

Thanks!

  • Ошибка python при делении на ноль
  • Ошибка python не является внутренней или внешней командой
  • Ошибка python importerror cannot import name
  • Ошибка pycharm failed to load jvm dll
  • Ошибка pxe mof exiting pxe rom на ноутбуке msi