为什么更改 LD_LIBRARY_PATH 在 Ubuntu 中不起作用? [英] Why changing LD_LIBRARY_PATH has no effect in Ubuntu?

查看:50
本文介绍了为什么更改 LD_LIBRARY_PATH 在 Ubuntu 中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 Ubuntu 16.04 上部署我的应用程序.所以我制作了一个具有以下层次结构的包 -

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

这里是 application.sh 文件 -

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

当我执行 application.sh 文件时,它显示我找不到 libQt5MultimediaWidgets.so.5 文件.但它在 Qt 文件夹中.此外,当我在导出 LD_LIBRARY_PATH 后从 application.sh 文件打印 ldd 应用程序 时,它给了我以下输出 -

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 -

请检查标记的部分.谁能解释为什么即使在导出 LD_LIBARRY_PATH 后也找不到 Qt 文件夹中的库?

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?

所以按照@Zang 的建议,我检查了调试日志,这里是 -

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

请检查标记的部分.

看起来它实际上是在尝试实际的 libQt5MultimediaWidgets.so 然后报告它无法找到它.任何人都可以帮我了解这里发生了什么吗?

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:根据@Tarun 的建议,我在 Qt 文件夹上运行了 ls -al.这是输出 -

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

推荐答案

如果你看看你的 ls -al

这些是您拥有的软链接.您的软链接 libQt5MultimediaWidgets.so.5 指向同一目录中的 libQt5MultimediaWidgets.so.5.9.2 并且该文件根本不存在.所以你需要设置正确的软链接路径或将文件放在同一目录中

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

这篇关于为什么更改 LD_LIBRARY_PATH 在 Ubuntu 中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆