【问题标题】:could not load a library无法加载库
【发布时间】:2026-01-23 14:55:01
【问题描述】:

我使用的工具反复返回一个错误,指出它无法在 <path_to_file> 加载库文件 (libppl.so.12: cannot open shared object file: No such file or directory)。问题是所需的文件确实在那里。

我尝试设置LD_LIBRARY_PATH,将条目添加到ld.so.confld.so.conf.d,然后运行ldconfig,这是我在下面提供的链接中找到的解决方案。然而,问题仍然存在。运行ldconfig -v 时,我可以看到它会查看文件目录,但不会为目录中的任何so 文件填充缓存,包括<path_to_file> 中的文件。

可能是什么问题?

有用的链接:

cannot open shared object file: No such file or directory

Linux error while loading shared libraries: cannot open shared object file: No such file or directory

【问题讨论】:

    标签: linux installation shared-libraries


    【解决方案1】:

    该工具可能是 32 位的,而您拥有该库的 64 位版本。 您可以通过file 命令检查二进制架构。

    另外,你可以通过LD_PRELOAD强制库

    【讨论】: