Ubuntu编译OpenWRT 15.05提示"Build dependency:Please install the xxx"

本文详细介绍了在Ubuntu18.04.1环境下编译OpenWrtChaosCalmer过程中遇到的各种依赖问题及解决方案,包括gcc、g++、ocaml、libncurses.so、libz.so、openssl库、Python2、subversion、git等关键组件的安装与配置。

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

在Ubuntu 18.04.1上编译OpenWrt Chaos Calmer的时候碰到了以下问题,记录一下。

Build dependency: Please install the GNU C Compiler (gcc)
Build dependency: Please reinstall the GNU C Compiler - it appears to be broken
Build dependency: Please install the GNU C++ Compiler (g++)
Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken
Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.12 or later
Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
Build dependency: Please install zlib. (Missing libz.so or zlib.h)
Build dependency: Please install the openssl library (with development headers)
Build dependency: Please install Python 2.x
Build dependency: Please install the Subversion client
Build dependency: Please install Git (git-core) >= 1.6.5

如果有碰到提示 - Unable to locate package xxx
请先参考https://blog.youkuaiyun.com/xiangxianghehe/article/details/80112149
把源换成国内源


Build dependency: Please install the GNU C Compiler (gcc)
Build dependency: Please reinstall the GNU C Compiler - it appears to be broken
原因
缺少gcc编译器
解决方法
安装gcc编译器
$ sudo apt-get install gcc

Build dependency: Please install the GNU C++ Compiler (g++)
Build dependency: Please reinstall the GNU C++ Compiler - it appears to be broken
原因
缺少g++编译器
解决方法
安装g++编译器
$ sudo apt-get install g++

Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.12 or later
原因
缺少ocaml编译器
解决方法
安装ocaml编译器
$ sudo apt-get install ocaml

注:此处用Ubuntu原来的源会碰到错误提示“Unable to locate package ocaml”,更换为阿里云后正常安装


Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
原因
缺少libncurses.so
解决方法
安装libncurses.so
$ sudo apt-get install libncurses5-dev

Build dependency: Please install zlib. (Missing libz.so or zlib.h)
原因
缺少libz.so
解决方法
安装libz.so
$ sudo apt-get install zlib1g-dev

Please install the openssl library (with development headers)
原因
缺少openssl库
解决方法
安装openssl库
$ sudo apt-get install libssl-dev

Build dependency: Please install Python 2.x
原因
缺少Python 2
解决方法
安装Python 2
$ sudo apt-get install python

Build dependency: Please install the Subversion client
原因
缺少subversion
解决方法
安装subversion
$ sudo apt-get install subversion

Build dependency: Please install Git (git-core) >= 1.6.5
原因一
缺少git
解决方法
安装git
$ sudo apt-get install git

注:如果已经安装git但是仍然收到该错误提示,请参考原因二,如果没有请忽略原因二。

原因二
已经安装git,但是版本是2.x
查看git版本
$ git --version
git version 2.17.1

由于对git版本的检测方式有缺陷导致,OpenWRT已经在
2016-03-05 21:07提交(4c80909fa141fe2921c62bd17b2b04153031df18)中修复该问题

解决方法
请参考 https://github.com/openwrt/openwrt/commit/4c80909fa141fe2921c62bd17b2b04153031df18
修改文件 include/prereq-build.mk 中git版本的判断命令。
我这里的判断命令依然是 git clone 2>&1 | grep – –recursive))
将其修改为 git –exec-path | xargs -I % – grep -q – –recursive %/git-submodule))
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
-   git clone 2>&1 | grep -- --recursive))
+   git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值