存在不同名称的共享库

Shared library present with different name

我使用 openssl 加密库 gcc 编译了我的程序。 我将可执行文件移动到另一个系统,并在安装 openssl 后尝试 运行 它。我收到以下错误:

error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

我从以下库中了解到存在,但有另一个名称:

locate libcrypto
/usr/lib64/.libcrypto.so.1.0.2f.hmac
/usr/lib64/.libcrypto.so.10.hmac
/usr/lib64/libcrypto.so
/usr/lib64/libcrypto.so.1.0.2f
/usr/lib64/libcrypto.so.10
/usr/lib64/pkgconfig/libcrypto.pc

我能以某种方式告诉二进制文件使用现有库之一吗?或者有没有办法安装所需的?

编译是在 Ubuntu 15.10 64 位上完成的,试图 运行 在 Fedora 4.2.3-300.fc23.x86_64.

Can I somehow tell the binary to use one of the present libraries?

不,你不能:原因这些库有不同的名称:它们不兼容 ABI。如果您设法以某种方式告诉二进制文件使用其他库,那么如果您幸运的话,结果将是崩溃,否则将是无声的损坏。

(顺便说一句,您 可以 通过创建符号 link 来尝试此操作:ln -s libcrypto.so.1.0.2f libcrypto.so.1.0.0,但您已被警告 不能 执行此操作)。

is there a way to install the one which is required?

当然:您应该能够将 libcrypto.so.1.0.0 从 Ubuntu 机器复制到 Fedora 机器,假设您找不到提供它的 Fedora 软件包。