Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
967 views
in Technique[技术] by (71.8m points)

qt - Why changing LD_LIBRARY_PATH has no effect in Ubuntu?

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

Package
|
----bin
    |
    -----application
    -----application.sh
    -----Qt
         |
         -----necessary qt libraries
         -----platforms

Here is the application.sh file -

#!/bin/sh
export LD_LIBRARY_PATH=`pwd`/Qt
./application

When i execute the application.sh file, it shows me that it cant find the libQt5MultimediaWidgets.so.5 file. But its in the Qt folder. Also when i print the ldd application from the application.sh file after exporting LD_LIBRARY_PATH it gives me following output -

enter image description here Please check the marked parts. Can anyone please explain why the libraries from the Qt folder are not found even after exporting the LD_LIBARRY_PATH?

Edit:

So as suggested by @Zang, i have checked the debug log and here it is -

Please check the marked parts.

enter image description here

It seems like its actually trying the actual libQt5MultimediaWidgets.so and then report that its unable to find it. Can anyone please help me understand whats happening here?

Edit-2: As per suggestion from @Tarun, i have ran ls -al on my Qt folder. Here is the output -

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...