openwrt: 编译失败 "Please install the openssl library (with development headers)"

本文解决了一个在编译OpenWRT过程中遇到的LibSSL相关问题,即使Ubuntu系统已安装openssl、libssl和libssl-dev,仍提示缺少LibSSL。提供了两种解决方案,并深入探讨了可能的原因。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

openwrt: 编译失败 “Please install the openssl library (with development headers)”

编译openwrt时,突然发现如下问题,困扰了好久。网上资料说安装openssl,libssl,libssl-dev,但是我ubuntu1604系统中发现,这些都已经安装了。最终,找到了解决办法:

解决办法

1. 方法1:

sudo apt install openssl libssl libssl-dev -y

如果不行,则试试如下方案

2. 方法2:

sudo apt remove libssl-dev

可能是libssl库冲突吧,我也搞不懂,open的检测机制。
简单看了下makefile,主要涉及到以下几个.mk文件

include/prereq-build.mk
包含如下mk文件
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/host-build.mk

检测libssl的地方,看不懂:(希望有人能够帮忙解惑)

sean@sean$ vi include/prereq-build.mk

$(eval $(call TestHostCommand,libssl, \
    Please install the openssl library (with development headers), \
    echo 'int main(int argc, char **argv) { SSL_library_init(); return 0; }' | \
        gcc $(HOST_CFLAGS) -include openssl/ssl.h -x c -o $(TMP_DIR)/a.out - -lcrypto -lssl $(HOST_LDFLAGS)))

问题详情

sean@sean$ make V=s
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'libssl'... failed.
Checking 'tar'... ok.
Checking 'find'... ok.
Checking 'bash'... ok.
Checking 'patch'... ok.
Checking 'diff'... ok.
Checking 'cp'... ok.
Checking 'seq'... ok.
Checking 'awk'... ok.
Checking 'grep'... ok.
Checking 'getopt'... ok.
Checking 'stat'... ok.
Checking 'md5sum'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'wget'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'svn'... ok.
Checking 'git'... ok.
Checking 'file'... ok.
Checking 'openssl'... ok.
Checking 'ldconfig-stub'... ok.

Build dependency: Please install the openssl library (with development headers)

/home/sean/work/tmp/openwrt_cat6/include/prereq.mk:12: recipe for target 'prereq' failed
Prerequisite check failed. Use FORCE=1 to override.
/home/sean/work/tmp/openwrt_cat6/include/toplevel.mk:140: recipe for target 'staging_dir/host/.prereq-build' failed
make[2]: *** [staging_dir/host/.prereq-build] Error 1
/home/sean/work/tmp/openwrt_cat6/include/toplevel.mk:69: recipe for target 'prepare-tmpinfo' failed
make[1]: *** [prepare-tmpinfo] Error 2
/home/sean/work/tmp/openwrt_cat6/include/toplevel.mk:181: recipe for target 'world' failed
make: *** [world] Error 2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值