Why changing LD_LIBRARY_PATH has no effect in Ubuntu?

前端 未结 4 1586
深忆病人
深忆病人 2020-12-19 04:55

I was trying to deploy my application on Ubuntu 16.04. So i made a package with the following hierarchy -

Package
|
----bin
    |
    -----appli         


        
相关标签:
4条回答
  • 2020-12-19 05:37

    First

    Could it be that the pwd is not where you assume it is?

    You could try adding

    # Figure out where the application.sh script is located
    scriptpath="$( cd "$(dirname "$0")" ; pwd -P )"
    # Make sure our pwd is that location
    cd  "$scriptpath"
    

    in the top of your script (assumes bash shell, from here)

    By doing this all relative paths to Qt folder will be valid.

    Second

    Maybe you should considder exporting your new LD_LIBRARY_PATH, like so (from here):

    LD_LIBRARY_PATH=whatever
    export LD_LIBRARY_PATH
    

    Third

    It may be useful to run ldconfig command for ld to update after changing the variable (from here):

    sudo ldconfig
    
    0 讨论(0)
  • 2020-12-19 05:43

    All files in Your Qt directory are actually simlinks to non-existing files in the same directory, therefore they cannot be found.

    0 讨论(0)
  • 2020-12-19 05:47

    If you look at the output of your ls -al

    These are soft links that you have. Your softlink libQt5MultimediaWidgets.so.5 points to libQt5MultimediaWidgets.so.5.9.2 in the same directory and the file is not there at all. So you need to either set the correct softlink path or have the file in same directory

    0 讨论(0)
  • 2020-12-19 05:53

    The file libQt5MultimediaWidgets.so is not present in /Desktop/package/bin/Qt according to the screenshots shown.

    0 讨论(0)
提交回复
热议问题