busybox 编译错误解决方法

本文讲述了在嵌入式Linux开发过程中遇到的问题,如Makefile修改、交叉编译错误和头文件缺失。方法1涉及环境变量调整,方法2重点在于修复netfilter.h头文件类型错误。作者分享了亲测解决方案,适用于初学者和经验者参考。

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

方法1:

虚拟机中有其他开发板,环境变量可能设置的不对,所以将Makefile中

ARCH            ?= $(SUBARCH)
CROSS_COMPILE   ?=arm-linux-

改成

ARCH            = $(SUBARCH)
CROSS_COMPILE   =arm-linux-

方法2:

在make busybox的时候出现如下错误:
/arm-none-linux-gnueabi/libc/usr/include/linux/netfilter.h:44: error: field ‘in’ has incomplete type
/arm-none-linux-gnueabi/libc/usr/include/linux/netfilter.h:45: 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
scripts/Makefile.build:192: recipe for target ‘ipsvd/tcpudp.o’ failed
make[1]: *** [ipsvd/tcpudp.o] Error 1
Makefile:701: recipe for target ‘ipsvd’ failed
make: *** [ipsvd] Error 2
下载的交叉编译库中有个头文件中的 in 和 in6 类型不对,解决的方法(亲自测试):
在 …/arm-none-linux-gnueabi/libc/usr/include/linux/netfilter.h 的开头
添加缺少的头文件:
#include <netinet/in.h>
已经解决
————————————————
版权声明:本文为优快云博主「PerseverancePrevails」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/qq_30592303/article/details/83270992

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sunxiaopengsun

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值