修改 networking/libiproute/iptunnel.c文件,加上如下头文件#include 。
1、编译和配置 busybox
错误 1:
In file included from /opt/opt/FriendlyARM/toolschain/4.4.3/bin/../arm-none-linux-gnueabi//sys- root/usr/include/linux/netfilter_ipv4.h:8,
from ipsvd/tcpudp.c:33:
/opt/opt/FriendlyARM/toolschain/4.4.3/bin/../arm-none-linux-gnueabi//sys- root/usr/include/linux/netfilter.h:55: error: field 'in' has incomplete type
/opt/opt/FriendlyARM/toolschain/4.4.3/bin/../arm-none-linux-gnueabi//sys- root/usr/include/linux/netfilter.h:56: error: field 'in6' has incomplete type
ipsvd/tcpudp.c: In function 'tcpudpsvd_main':
ipsvd/tcpudp.c:314: warning: ignoring return value of 'write', declared with attribute warn_unused_result
make[1]: *** [ipsvd/tcpudp.o] 错误 1
make: *** [ipsvd] 错误 2
解决办法:在/opt/opt/FriendlyARM/toolschain/4.4.3/bin/../arm-none-linux-gnueabi//sys-root/usr/include/linux/netfilter.h中缺少头文件,加上所缺少的头文件:
#include>
note:/opt/opt/FriendlyARM/toolschain/4.4.3/bin/为交叉编译链工具arm-linux-gcc的安装路径,也可能是其他路径,在错误信息中所显示的既是索要找的路径
错误 2:
Failed: arm-linux-gcc -o busybox_unstripped -Wl,-Map -Wl,busybox_unstripped.map -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections -Wl,--start-group applets/built-in.o archival/lib.a archival/libunarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a ipsvd/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a archival/built-in.o archival/libunarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o ipsvd/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -Wl,--end-group
modutils/lib.a(insmod.o): In function `insmod_main':
insmod.c:(.text.insmod_main+0xe74): warning: warning: create_module is not implemented and will always fail
insmod.c:(.text.insmod_main+0x454): warning: warning: query_module is not implemented and will always fail
networking/libiproute/lib.a(iptunnel.o): In function `print_tunnel':
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
make: *** [busybox_unstripped] 错误 1
解决办法:
错误信息中显示在networking/libiproute/iptunnel.c中未定义`__cpu_to_be16'
修改 networking/libiproute/iptunnel.c文件,加上如下头文件
#include<asm/byteorder.h>
完成其他工作,步骤:
1. 下载busybox,解压
2. makemenuconfig ,配置属性
3.make
错误3:
make[1]: *** [networking/libiproute/iptunnel.o] Error 1
make: *** [networking/libiproute] Error 2
解决:
重新 make menuconfig,
去掉networking utilites->ip tunnel选项