正在/usr/local/lib搜索共享库吗?我有这个错误:
/usr/local/lib
[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目录设置为包括要搜索的所有目录,然后再次进行测试。
LD_LIBRARY_PATH
您可以使用以下方法快速进行测试:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ffmpeg
这将只为该调用设置它。
或者,您可以编辑/etc/ld.so.conf其中包含搜索的默认目录。/usr/local/lib该文件中可能不包含某些Linux发行版。
/etc/ld.so.conf
请注意,您可能还需要/etc/ld.so.cache通过运行ldconfig(以root身份或使用sudo)来更新缓存。
/etc/ld.so.cache
ldconfig
sudo