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/ file too short

    The 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 ?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Check the file with ldd to see if it points to a valid library

  • Thank you.
    My Device does not know ldd.
    On my PC ldd says "Das Programm ist nicht dynamisch gelinkt" The programm isn't linked dynamic.

  • Lifetime Qt Champion

    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

  • It seems I don't have file too. How can I copy ldd ?

  • Lifetime Qt Champion

    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:


    ldd returns this:
    root@phyBOARD-MAIA-AM335x:~ ./AirMonTool
    ./AirMonTool: error while loading shared libraries: /opt/qt-cross-hf/lib/ file too short
    root@phyBOARD-MAIA-AM335x:~ ldd AirMonTool
    $ not a dynamic executable

    and 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
    -rw-r--r-- 1 root root 24 Jan 1 1970
    -rw-r--r-- 1 root root 24 Jan 1 1970

  • Lifetime Qt Champion

    Looks like your files are corrupted. and that you have 3 copies of libQtSerialPort rather than one and two symbolic links

Log in to reply