You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决编译xar-1.5.2时出现的“缺少libcrypto(OpenSSL)”错误?

解决Antix 22上编译xar-1.5.2时的libcrypto依赖错误

问题概述

编译xar-1.5.2时,因libssl1.0-dev无法安装改用libssl-dev,但执行./configure时出现报错:

checking for OpenSSL_add_all_ciphers in -lcrypto... no
configure: error: Cannot build without libcrypto (OpenSSL)

系统已安装openssl,仍触发该错误。

解决方案

1. 重新安装libssl-dev

确保openssl开发包完整无损坏,执行:

sudo apt-get install --reinstall libssl-dev

2. 手动指定openssl路径给configure

xar-1.5.2版本较旧,无法自动识别新版openssl的默认路径,执行configure时明确指定库和头文件位置:

# 64位系统使用此命令
./configure --with-openssl=/usr/lib/x86_64-linux-gnu --with-openssl-include=/usr/include/openssl

# 32位系统替换为以下命令
# ./configure --with-openssl=/usr/lib/i386-linux-gnu --with-openssl-include=/usr/include/openssl

3. 强制设置链接参数

如果上述方法无效,先通过环境变量强制指定链接libcrypto库:

export LDFLAGS="-lcrypto"
./configure

4. 完成编译安装

配置成功后,继续执行编译和安装命令:

make
sudo make install

内容的提问来源于stack exchange,提问作者mikezang

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 04:16:43