shared libraries file too short
-
Hi,
I want to use QtSerialPort on an embedded Linux device which only supports Qt 4.8.5.
So I followed the wiki and this.
I have added the library to my Crosscompiler and compiling now works.When I want to start the programm on my device I get this error:
error while loading shared libraries: /opt/qt-cross-hf/lib/libQtSerialPort.so.1: file too shortThe files in the /opt/qt-cross-hf/lib/ are the same as in my crosscompiler and at the same path.
Any ideas how to fix this ?
-
Hi and welcome to devnet,
Check the file with ldd to see if it points to a valid library
-
ldd is a script that will load and do some processing on your libraries, so you can't call it on a library that's built for a different architecture.
Then if you don't have it on your target (you can copy ldd on your target) you can use the file command to see what type of file is libQtSerialPort.so.1
-
What OS are you running on your target ?
Then what does ls -la return ?
The same way you copy your other files on your target
-
The OS is:
NAME=PTXdist
VERSION="2013.01.0"
ID=ptxdist
VERSION_ID="2013.01.0"
PRETTY_NAME="PTXdist / PHYTEC-phyBOARD-MAIA-AM335x"
ANSI_COLOR="1;34"PTXDIST_VERSION="2013.01.0"
PTXDIST_BSP_VENDOR="PHYTEC"
PTXDIST_BSP_NAME="phyBOARD-MAIA-AM335x"
PTXDIST_BSP_VERSION="-PD14.0.0"
PTXDIST_PLATFORM_NAME="phyBOARD-MAIA-AM335x"
PTXDIST_PLATFORM_VERSION="-PD14.0.0"
PTXDIST_BUILD_DATE="2014-02-12T15:27:59+0100"ldd returns this:
root@phyBOARD-MAIA-AM335x:~ ./AirMonTool
./AirMonTool: error while loading shared libraries: /opt/qt-cross-hf/lib/libQtSerialPort.so.1: file too short
root@phyBOARD-MAIA-AM335x:~ ldd AirMonTool
$ not a dynamic executableand ls returns:
root@phyBOARD-MAIA-AM335x:/opt/qt-cross-hf/lib ls -la
drwxr-xr-x 2 root root 640 Jan 1 1970 .
drwxrwxrwx 3 root root 224 Jan 1 1970 ..
-rw-r--r-- 1 root root 452 Jan 1 1970 libQtSerialPort.prl
-rw-r--r-- 1 root root 24 Jan 1 1970 libQtSerialPort.so
-rw-r--r-- 1 root root 24 Jan 1 1970 libQtSerialPort.so.1
-rw-r--r-- 1 root root 24 Jan 1 1970 libQtSerialPort.so.1.0 -
Looks like your files are corrupted. and that you have 3 copies of libQtSerialPort rather than one and two symbolic links