2

我正在使用Qt 4.7.4Qt Creator 2.4.1。我正在尝试为串行通信构建blockingmaster 代码,例如Qt 站点上给出的示例。

但是在对我的环境和路径目标进行了必要的修改之后,当我尝试构建项目时。它给了我:

QtSerialPort/QSerialPortInfo: No such file or directory

关注链接后(没有成功);

我的 .pro 文件如下所示:

CONFIG += serialport
QT += widgets

TARGET = blockingmaster
TEMPLATE = app

HEADERS += \
    dialog.h \
    masterthread.h

SOURCES += \
    main.cpp \
    dialog.cpp \
    masterthread.cpp

但错误仍然是一样的。我已经尝试了一些东西。

通过 QT 进行串行通信对我来说是一项新任务,所以我尝试使用 Qt 网站上给出的示例。谁能向我提供更多信息以消除此错误?

4

3 回答 3

3

Thanks to all for their valuable suggestions.

QtSerialPort library is an added feature for Qt5 .It is always advisable to use inbuilt library created by qt.

Since QtSerialPort library is not supported by Qt 4.7 or lower version.

I was able to design an Application using Qt 4.7 itself. It needs to include library for serial communication as Qt 4.7 has no in-build library for serial port. I did it using following link :

For Windows add the "qextserialport-1.2rc" (download using following link)

Qextserialport Example - Hyperterminal Windows

For Linux add library "myser1.zip" (download using following link)

Qextserialport Example - Hyperterminal Linux

Above links also includes the application for Serial Communication for respective OS. Adding the libraries from the above application helped me designing an Application for my task.

The above answer will help the developers who are not permissible to upgrade Qt-tool due to company policy etc.

Hope this will help others to solve the similar problems.

于 2013-08-16T04:38:05.187 回答
2

Could you please try 4.8?

It should work with that, but try first without Qt Creator, and then if it works, with the IDE.

We have not tested 4.7 lately, hence there might be issues. 4.8 should work. If something does not, we need to find the root cause, file a bugreport, and we will fix it.

Here you can find more information about this module that I wrote up when it was becoming an official Qt add-on.

于 2013-08-14T20:34:52.870 回答
1

您正在查看的示例适用于 Qt 5(甚至可能是 5.1),它不适用于 Qt 4。尝试最新的 5.1 候选版本。

于 2013-07-03T08:30:43.580 回答