编译busybox的时候出现error: field 'in' has incomplete type

1、操作系统:Ubuntu16.04

2、交叉编译工具链:arm-linux-gcc4.4.3

3、busybox版本:busybox-1.7.0

解压源码包 tar -jxvf busybox-1.7.0

1.make menuconfig

 

出现错误:

Makefile:405: *** mixed implicit and normalrules: deprecated syntax

Makefile:1242: *** mixed implicit andnormal rules: deprecated syntax

 

原因Make工具太新

修改Makefile

修改前:405行 config %config: scripts_basic outputmakefile FORCE

修改后:405 行 %config: scripts_basic outputmakefile FORCE

修改前:1242 行 / %/: prepare scripts FORCE

修改后:1242 行 %/: prepare scripts FORCE

继续make menuconfig

出现错误

scripts/kconfig/lxdialog/dialog.h:31:20:fatal error: curses.h: 没有那个文件或目录

compilation terminated.

make[2]: ***[scripts/kconfig/lxdialog/checklist.o] 错误 1

make[1]: *** [menuconfig] 错误 2

make: *** [menuconfig] 错误 2

 

因为ubuntu系统中缺少一个套件 ncurses devel ,把此套件安装即可

apt-get install libncurses5-dev


保存之后make menuconfig进行相关设置

2.修改makefile

 

175 ARCH      ?= $(SUBARCH)

176 CROSS_COMPLE ?=

 

修改为

175 ARCH      ?= arm

176 CROSS_COMPLE ?= arm-linux-

 

3.执行make

错误:make[1]: *** [ipsvd/tcpudp.o] Error 1

Makefile:701: recipe for target 'ipsvd'failed

make: *** [ipsvd] Error 2

 

/usr/local/arm/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/sys-root/usr/include/linux

netfilter.h 头文件的开头

添加缺少的头文件:

#include <netinet/in.h>


错误:

iptunnel.c:(.text.print_tunnel+0x1ec):undefined reference to `__cpu_to_be16'

iptunnel.c:(.text.print_tunnel+0x200):undefined reference to `__cpu_to_be16'

iptunnel.c:(.text.print_tunnel+0x238):undefined reference to `__cpu_to_be16'

iptunnel.c:(.text.print_tunnel+0x24c):undefined reference to `__cpu_to_be16'

iptunnel.c:(.text.print_tunnel+0x26c):undefined reference to `__cpu_to_be16'

networking/libiproute/lib.a(iptunnel.o):iptunnel.c:(.text.print_tunnel+0x290):more undefined references to `__cpu_to_be16' follow

collect2: ld returned 1 exit status

Makefile:678: recipe for target'busybox_unstripped' failed

make: *** [busybox_unstripped] Error 1

 

修改 networking/libiproute/iptunnel.c文件

在#include <asm/types.h>

后面加上

#include <asm/byteorder.h>

之后即可重新make通过

--------------------- 
作者:a458895535 
来源:CSDN 
原文:https://blog.csdn.net/a458895535/article/details/73004476 
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值