构建 xar 源错误:没有 libcrypto?

构建 xar 源错误:没有 libcrypto?

我正在从源代码构建 xar (https://github.com/mackyle/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)
...

我的 openssl 库有什么问题?

答案1

现在有一个解决方案,只需要进行一些小改动。您可以在Github 问题

这是您需要做的事情:在 中configure.ac,第 332 行是:

AC_CHECK_LIB([crypto], [OpenSSL_add_all_ciphers], , [have_libcrypto="0"])

替换为:

AC_CHECK_LIB([crypto], [OPENSSL_init_crypto], , [have_libcrypto="0"])

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

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

答案2

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

请注意,在 Ubuntu 18.04 LTS 上,您不能同时安装和libssl-devlibssl1.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.

答案3

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

答案4

安装libssl1.0-dev

sudo apt install libssl1.0-dev

创建配置后的输出:

checking for openssl/evp.h... yes
checking for OpenSSL_add_all_ciphers in -lcrypto... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for deflate in -lz... yes
checking bzlib.h usability... no
checking bzlib.h presence... no
checking for bzlib.h... no
checking for BZ2_bzCompress in -lbz2... no
configure: creating ./config.status
config.status: creating cfgoutputs.stamp
config.status: creating Makefile
config.status: creating include/xar.h
config.status: creating lib/Makefile.inc
config.status: creating lib/libxar.la.in
config.status: creating src/Makefile.inc
config.status: creating xar.spec
config.status: creating cfghdrs.stamp
config.status: creating include/config.h

相关内容