PDA

View Full Version : Error while loading shared libraries: libQtSerialPortE.so.1



nagendrababu
9th October 2017, 05:08
Hi All,
I am pretty new to QT and trying to develop a QT application for embedded linux on emcraft imx board. I am trying to use QSerialPort to access on of my UART.


void Hardware::initHW(QObject *parent,QSerialPort *serial)
{
serial = new QSerialPort(parent);
//SerialPort for UART3
serial->setPortName("/dev/ttymxc2");
//If already Opened Close it First
if(serial->open(QIODevice::ReadWrite))
{
serial->close();
qDebug() << "port already opened";
}
//If open succssfully
if(serial->open(QIODevice::ReadWrite))
{
qDebug() << "port opened successfully";
serial->setBaudRate(QSerialPort::Baud115200);
serial->setParity(QSerialPort::NoParity);
serial->setParity(QSerialPort::NoParity);
serial->setStopBits(QSerialPort::OneStop);
serial->setFlowControl(QSerialPort::NoFlowControl);
serial->setDataBits(QSerialPort::Data8);
serial->write("QT Started");
}
}
When I try to run this application from my embedded linux, I am seeing the following error.
./i7widget: error while loading shared libraries: libQtSerialPortE.so.1: cannot open shared object file: No such file or directory
Can you please help me to fix this problem.

Thanks,
Nagendra.

ado130
9th October 2017, 09:08
Check this link http://doc.qt.io/qt-5/qtserialport-index.html and look at the qmake .pro file.

nagendrababu
9th October 2017, 09:35
Hi @ado130,
Thanks for your reply. I did already add that to .pro file but still facing the issue.
Any more insights.
Thanks,
Nagendra.

ado130
9th October 2017, 13:08
I found this topic, try to follow it. https://forum.qt.io/topic/49555/solved-serialport-trouble/7

nagendrababu
11th October 2017, 07:33
Hi @ado130,
Thank you,The link you shared solved the problem.

-Nagendra