Qt 4.7 QtSerialPort/QSerialPortInfo : No Such file or Directory

skg picture skg · Jul 3, 2013 · Viewed 8.3k times · Source

I am using Qt 4.7.4 and Qt Creator 2.4.1. I am trying to build blockingmaster code for serial communication, example given on Qt site.

But after required modification for my environment and path destination, when I tried to build the project. It gives me:

QtSerialPort/QSerialPortInfo: No such file or directory

After following this link (with no success);

My .pro file looks like:

CONFIG += serialport
QT += widgets

TARGET = blockingmaster
TEMPLATE = app

HEADERS += \
    dialog.h \
    masterthread.h

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

But the error remains the same. I have tried the things upsite down.

Serial communication via QT is a new task for me, so I was trying with example given on Qt website. Can anyone provide me more information to get rid of this error?

Answer

skg picture skg · Aug 16, 2013

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.