Nominate our 2022 Qt Champions!

Dynamically linked Qt app for Linux - what is the criterion of compatibility amonge Linux versions

  • Hi. I went into some problem with deployment of dynamically linked QT program for Linux.
    Giuded by recommemded technic ( I've craeted the package with startup script in Kubuntu 14-4.
    It starts with no problems in different installations of ubuntu family linuxes of the same 14 version with no explicitly installed Qt.
    Used to windows I have been hoped for some backward campatibility and try to install my app in Kubuntu 15, but that faild in the starange way.
    It fails throught the script but starts successfully when simply clicking on executable. It turns out that Kubuntu 15 have all nessesary libs preinstalled

    I've sligtly modified the script to investigate the cause of fault :

    • #!/bin/sh
      appname=basename $0 | sed s,\.sh$,,
      dirname=dirname $0
      if [ "${dirname%$tmp}" != "/" ]; then
      export LD_LIBRARY_PATH
      ldd $dirname/$appname
      $dirname/$appname "$@" *

    Linux here:

    valera@valera-VirtualBox:~$ uname -a
    Linux valera-VirtualBox 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:01 UTC 2015 i686 athlon i686 GNU/Linux


    *valera@valera-VirtualBox:~/brama_cp_l_1.1.1-2_i386$ ./ => (0xb76e9000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb6fa5000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb68ed000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb63a4000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb62bc000) => /lib/i386-linux-gnu/ (0xb6282000) => /lib/i386-linux-gnu/ (0xb60c7000) => /lib/i386-linux-gnu/ (0xb60a9000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb6057000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb6054000) => /lib/i386-linux-gnu/ (0xb604b000) => /lib/i386-linux-gnu/ (0xb5f23000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb5f0f000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb5ddb000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb5d7b000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb5d35000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb5abc000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb5913000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb40e8000) => /lib/i386-linux-gnu/ (0xb40e3000)
    /lib/ (0xb76ea000) => /usr/lib/i386-linux-gnu/ (0xb40d9000) => /lib/i386-linux-gnu/ (0xb4067000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb4044000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb402c000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb4028000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb4022000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb401f000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb4006000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb4000000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3ffc000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3ff8000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3ff1000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3fed000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3fe7000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3fd9000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3fd5000) => /home/valera/brama_cp_l_1.1.1-2_i386/./ (0xb3fcd000)
    Segmentation fault (core dumped) *

    Here is output of ldd for executable itself:

    valera@valera-VirtualBox:~/brama_cp_l_1.1.1-2_i386$ ldd ./Brama_L => (0xb7715000) => /usr/lib/i386-linux-gnu/ (0xb6fa0000) => /usr/lib/i386-linux-gnu/sse2/ (0xb6a11000) => /usr/lib/i386-linux-gnu/sse2/ (0xb64d1000) => /usr/lib/i386-linux-gnu/ (0xb63dc000) => /lib/i386-linux-gnu/ (0xb63bf000) => /lib/i386-linux-gnu/ (0xb6204000) => /lib/i386-linux-gnu/ (0xb61e7000) => /usr/lib/i386-linux-gnu/ (0xb6189000) => /lib/i386-linux-gnu/ (0xb6061000) => /usr/lib/i386-linux-gnu/ (0xb5f16000) => /lib/i386-linux-gnu/ (0xb5ec9000) => /lib/i386-linux-gnu/ (0xb5e9d000) => /usr/lib/i386-linux-gnu/ (0xb5e3e000) => /lib/i386-linux-gnu/ (0xb5e23000) => /usr/lib/i386-linux-gnu/mesa/ (0xb5d75000) => /usr/lib/i386-linux-gnu/ (0xb5b55000) => /usr/lib/i386-linux-gnu/ (0xb59d4000) => /lib/i386-linux-gnu/ (0xb59ce000) => /lib/i386-linux-gnu/ (0xb59c5000)
    /lib/ (0xb7716000) => /usr/lib/i386-linux-gnu/ (0xb59bb000) => /lib/i386-linux-gnu/ (0xb5949000) => /usr/lib/i386-linux-gnu/ (0xb5927000) => /usr/lib/i386-linux-gnu/ (0xb5876000) => /usr/lib/i386-linux-gnu/ (0xb5859000) => /lib/i386-linux-gnu/ (0xb5830000) => /usr/lib/i386-linux-gnu/ (0xb5817000) => /usr/lib/i386-linux-gnu/ (0xb5802000) => /usr/lib/i386-linux-gnu/ (0xb57fd000) => /usr/lib/i386-linux-gnu/ (0xb57f6000) => /usr/lib/i386-linux-gnu/ (0xb57f3000) => /usr/lib/i386-linux-gnu/ (0xb57db000) => /usr/lib/i386-linux-gnu/ (0xb57d5000) => /usr/lib/i386-linux-gnu/ (0xb57d0000) => /usr/lib/i386-linux-gnu/ (0xb57cc000) => /usr/lib/i386-linux-gnu/ (0xb57c5000) => /usr/lib/i386-linux-gnu/ (0xb57c2000) => /usr/lib/i386-linux-gnu/ (0xb57bc000) => /usr/lib/i386-linux-gnu/ (0xb57ac000) => /usr/lib/i386-linux-gnu/ (0xb413f000) => /usr/lib/i386-linux-gnu/ (0xb413b000) => /usr/lib/i386-linux-gnu/ (0xb4134000)

    	**Launching it directly yields  SUCCESS!!!!!!!!!!!!!!!!**

    Obviously OS allways engages system dynamic linker paying no attention for my
    LD_LIBRARY_PATH redirection (probably this directive is for linker itself). It's ok but furthermore -
    the list of library it demands appears slightly different. When I repeat the procedure of package
    library collection in Kubuntu 15 - it works in both cases: with script and directly. It seems like the
    linker treats the needs of my program for libs in ambiguous way, trying to deside itself what the
    app really needs. The question is: In the world where is so many linuxes

    • what is the criterion of compatibility for dinamically linked programs? Is it bound to the Linux distro -
      exactly the same version where it was created? May be it is not strictly about QT, may be even offtopic here,
      but I hope this subject could be interesting for many people. I've made workaround for this issue - modified
      the script to try both way:direct launcing and with changed LD_LIBRARY_PATH, but it's ugly ant not relyable,
      as for me, rather I want to understand this "mechanics". I would be grateful for any useful advice. Links for some
      clear documentation would be the best for me.