Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[Solved] SerialPort Trouble
I'm using a TI Sitara EVM-SK and QT Creator 2.71 based on Qt 4.8.4 running on Ubuntu 12.04 32 bit.
I'm trying to the serialport library to allow me to use a UART on my device.
My project works if I remove any reference to the serialport libraries.
I have added @CONFIG += serialport@ to my project file.
I've tried following the Wiki, and I believe I have the SerialPort library installed.
I have copied the "Include" directory into my working directory for my project. At least as far as the QT Creator IDE goes, it seems to recognize the SerialPort commands.
I start running into trouble when I cross compile the program and try to debug it on my target device. I get the error: "error while loading shared libraries: libQtSerialPortE.so.1: cannot open shared object file: No such file or directory". My debugger immediately exits without running the program. Trying to combat this error, I have copied the file it was looking for to the same directory as the executable on the target device, but this has not made a difference.
Trying a different approach, I tried to run the included example "Terminal", but this gives me trouble as well. When I try to debug the program, I get the error "During startup program exited with code 126".
Any tips are appreciated.
please provide your steps what do you do (how you build and install qtserialport).
In my home folder, I've created a directory called "serialport-build". In my home folder I've also got the "qt-qtserialport" directory containing all downloaded files.
I cd into the serialport-build directory, run the command @qmake ../qt-qtserialport/qtserialport.pro@
then run the command make
then sudo make install. This seemed to go through without any errors.
It is made on host or on target device? Do you have libQtSerialPortE.so.1 file?
It is made on the host. I have a libQtSerialPortE.so.1 file on my host, and I have also copied it into the same directory as the executable on the target directory (windows-style) but that did not work either.
In Linux a "windows-style" does not works. You should to copy your libQtSerialPortE.so.1 to Qt directory (which contains the QtCore and so on *so) on your target board. Or you can start your application on target with specify the LD_LIBRARY_PATH env. So, this issue is Linux-specific, please read about shared libraries and so on in Linux.
Thank you kuzulis. Copying the file to the same directory as the QtCore and other *.so files has fixed my issue.