安卓busybox怎么编译c语言,关于c:编译busybox错误汇总

提醒谬误:

arm-linux-gcc:Command not found

PATH里有/usr/oca/arm/bin,然而make的时候,就是找不到 arm-linux-gcc

起因:

export PATH=$PATH:/usr/local/arm/bin是设置以后用户的PATH,而sudo执行make的时候,应用的是超级用户权限,那也就应用了超级用户的PATH(然而这个PATH里,并没有/usr/ local/arm/bin)

解决办法:

先关上一个超级用户权限的

sudo -s

在以后模式下,设置环境变量export PATH=$PATH /usr/local/arm/bin,再进入到busybox目录, make CONFIG_PREFIX=/work/nfs_root/first_fs install,就胜利装置busybox了。

提醒谬误:

/home/book/work/busybox-1.7.0/scripts/gcc-version.sh: line 11: arm-linux-gcc: command not found

/home/book/work/busybox-1.7.0/scripts/gcc-version.sh: line 11: arm-linux-gcc: command not found

CC applets/applets.o

/bin/sh: 1: arm-linux-gcc: not found

scripts/Makefile.build:192: recipe for target ‘applets/applets.o’ failed

make[1]: * [applets/applets.o] Error 127

Makefile:701: recipe for target ‘applets’ failed

make: * [applets] Error 2

起因:

穿插编译器的绝对路径与相对路径问题

解决办法:

在busybox的顶层Makefile 176行 CROSS COMPILE ?= 中增加/work/tools/gcc-3.4.5-glibc-2.3.6/bin/arm-linux-的绝对路径就胜利了。(为什么以前用arm-linux-就能够本人找到?)

提醒谬误:

CC applets/applets.o

In file included from include/busybox.h:10,

from applets/applets.c:16:

include/libbb.h:15: error: syntax error before ‘

In file included from /work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/dirent.h:62,

from include/libbb.h:16,

from include/busybox.h:10,

from applets/applets.c:16:

/work/tools/gcc-3.4.5-glibc-2.3.6/lib/gcc/arm-linux/3.4.5/../../../../arm-linux/sys-include/bits/dirent.h:35: error: syntax error before ‘}’ token

applets/applets.c: In function `get_trimmed_slice’:

applets/applets.c:102: warning: implicit declaration of function `isspace’

scripts/Makefile.build:192: recipe for target ‘applets/applets.o’ failed

make[1]: * [applets/applets.o] Error 1

Makefile:701: recipe for target ‘applets’ failed

make: * [applets] Error 2

起因:

短少必要头文件

解决办法:

批改busybox中的源码:include/libbb.h 中,减少一行#include 。

如遇到排版错乱的问题,能够通过以下链接拜访我的CSDN。

**CSDN:[CSDN搜寻“嵌入式与Linux那些事”]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值