QtSerialPort QSerialPort 没有这样的文件或目录
QtSerialPort QSerialPort no such file or directory
我使用本教程:http://doc-snapshot.qt-project.org/qt5-stable/qtserialport/blockingmaster.html
但是当我想运行它时,Qt Creator会生成以下错误:
错误:QT 中的未知模块:串行端口
当我将鼠标放在#include <QtSerialPort/QSerialPort>
上时,它说:
不包含此类文件或目录
我使用Qt 5.0.1
有什么想法吗?
尝试包含#include <QtSerialPort/QSerialPort>
而不是
#include <QSerialPort>
,这对我有用
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,Qt 5.1的RC1刚刚发布。您可以在此处下载: http://download.qt-project.org/development_releases/qt/5.1/5.1.0-rc1/
尝试包含
#include <QtSerialPort/QSerialPort>
同时更新您的 project.pro 文件,添加此标志
QT += serialport
清理完毕后,Qmake,重建项目
相关文章:
- .cpp和.h文件中的模板专用化声明
- 为什么两个不同的未命名名称空间可以共存于一个cpp文件中
- 文本文件中的单词链表
- CMake-按正确顺序将项目与C运行时对象文件链接
- 使用新行和不使用新行读取文件
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 挂起和取消挂起一个文件DLL
- 如何确定我已使用非编码文件到达 EOF?
- 命名空间中具有.h和.cpp文件的类
- 如何使用ndk-build.cmd构建Android.so文件
- 从包含m行的文件中提取n行,必要时(惰性地)重复该文件
- 读取文件并输入到矢量中
- 在C++中查找文件
- c++库的公共头文件中应该包含什么
- 用c++从输入文件中读取另一行
- Cppcheck生成xml转储文件
- 读取文件的最后一行并输入到链接列表时出错
- 无法编译 rtmidi 测试 cmidiin.cpp 文件, 非法指令
- QtSerialPort QSerialPort 没有这样的文件或目录
- 如何使用QSerialPort读取数据,使用QFile写入文件