构建 xar 源错误:没有 libcrypto?

Woo*_* Wu 8 openssl

我正在从源代码(https://github.com/mackyle/xar)构建 xar 。它抱怨我没有 OpenSSL,但我有它(我的系统安装了 openssl 包,我的 lib 目录中有 libcrypto.so.1.1.1 文件)。

以下是构建 xar 时来自 ./configure 命令的错误消息:

...
checking for OpenSSL_add_all_ciphers in -lcrypto... no
configure: error: Cannot build without libcrypto (OpenSSL)
...
Run Code Online (Sandbox Code Playgroud)

我的 openssl 库有什么问题?

小智 6

现在有一个修复程序,它只需要一些小的更改。你可以在Github issue 中阅读它。

这是您需要做的:在configure.ac第 332 行是:

AC_CHECK_LIB([crypto], [OpenSSL_add_all_ciphers], , [have_libcrypto="0"])
Run Code Online (Sandbox Code Playgroud)

替换为:

AC_CHECK_LIB([crypto], [OPENSSL_init_crypto], , [have_libcrypto="0"])
Run Code Online (Sandbox Code Playgroud)

请注意,唯一的变化是括号中的第二部分。您可以在此处查看此更改的示例。

然后运行./autogen.sh。之后,您可以使用make和继续安装sudo make install

  • 请注意大小写从“OpenSSL_...”更改为“OPENSSL_...”——这一点很容易被忽略。 (2认同)

N0r*_*ert 1

如果您需要编译它,那么在这种特殊情况下您需要安装 libssl1.0-dev软件包。

请注意,在 Ubuntu 18.04 LTS 上,您无法同时安装libssl-dev和:libssl1.0-dev

$ sudo apt install libssl-dev libssl1.0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libssl-dev : Conflicts: libssl1.0-dev but 1.0.2n-1ubuntu5.2 is to be installed
 libssl1.0-dev : Conflicts: libssl-dev but 1.1.0g-2ubuntu4.3 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)


Vel*_*kan 0

为了能够构建,需要额外的 *-dev 包。大概libssl-dev在这种情况下。