/ usr / local / lib是否搜索共享库? [英] Is /usr/local/lib searched for shared libraries?

查看:190
本文介绍了/ usr / local / lib是否搜索共享库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否 / usr / local / lib 搜索共享库?我有这个错误:

Is /usr/local/lib searched for shared libraries ? I have this error:

[Leo@chessman ~]$ whereis ffmpeg
ffmpeg: /usr/local/bin/ffmpeg
[Leo@chessman ~]$ ffmpeg
ffmpeg: error while loading shared libraries: libavcore.so.0: cannot open shared object file: No such file or directory
[Leo@chessman ~]$ ls /usr/local/lib/libav*
/usr/local/lib/libavcodec.a            /usr/local/lib/libavfilter.a
/usr/local/lib/libavcodec.so           /usr/local/lib/libavfilter.so
/usr/local/lib/libavcodec.so.52        /usr/local/lib/libavfilter.so.1
/usr/local/lib/libavcodec.so.52.108.0  /usr/local/lib/libavfilter.so.1.74.0
/usr/local/lib/libavcore.a             /usr/local/lib/libavformat.a
/usr/local/lib/libavcore.so            /usr/local/lib/libavformat.so
/usr/local/lib/libavcore.so.0          /usr/local/lib/libavformat.so.52
/usr/local/lib/libavcore.so.0.16.1     /usr/local/lib/libavformat.so.52.94.0
/usr/local/lib/libavdevice.a           /usr/local/lib/libavutil.a
/usr/local/lib/libavdevice.so          /usr/local/lib/libavutil.so
/usr/local/lib/libavdevice.so.52       /usr/local/lib/libavutil.so.50
/usr/local/lib/libavdevice.so.52.2.3   /usr/local/lib/libavutil.so.50.36.0
[Leo@chessman ~]$ 


推荐答案

确保您的 LD_LIBRARY_PATH 设置为包括您要搜索的所有目录,然后再次测试。

Make sure your LD_LIBRARY_PATH is set up to include all directories you want to search and then test it again.

您可以通过以下方式快速测试:

You can test this quickly with:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ffmpeg



which will set it only for that invocation.

或者,您可以编辑 /etc/ld.so.conf 其中包含搜索的默认目录。某些Linux发行版可能不包含该文件中的 / usr / local / lib

Alternatively, you can edit /etc/ld.so.conf which contains the default directories searched. Some Linux distributions may not include /usr/local/lib in that file.

请注意,您可能还需要通过运行$ $来更新缓存 /etc/ld.so.cache c $ c> ldconfig (作为root用户,或使用 sudo )。

Note that you may also need to update the cache /etc/ld.so.cache by running ldconfig (as root, or with sudo).

这篇关于/ usr / local / lib是否搜索共享库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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