سؤال

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?

هل كانت مفيدة؟

المحلول 2

QtSerialPort module is not part of Qt 5.0. It was added to the upcoming release Qt 5.1.

You are looking at the documentation snapshot for the upcoming release Qt 5.1. See http://doc-snapshot.qt-project.org/qt5-stable/qtdoc/index.html.

The documentation for Qt 5.0 is here: http://qt-project.org/doc/qt-5.0/qtdoc/index.html.

If you still want to try QtSerialPort, the RC1 of Qt 5.1 was just released. You can download it here: http://download.qt-project.org/development_releases/qt/5.1/5.1.0-rc1/

نصائح أخرى

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

try including

#include <QtSerialPort/QSerialPort>

also update your project.pro file, add this flag

QT += serialport

after that clean , qmake , rebuild the project

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top