发布网友 发布时间:2022-04-11 22:36
共1个回答
热心网友 时间:2022-04-12 00:05
#我解压tarball后,在目录下建立了build文件夹,我在build目录里开始编译。makeKBUILD_SRC=../-f../Makefiledefconfigsed-e's/.*FEATURE_PREFER_APPLETS.*/CONFIG_FEATURE_PREFER_APPLETS=y/'-i.configsed-e's/.*FEATURE_SH_STANDALONE.*/CONFIG_FEATURE_SH_STANDALONE=y/'-i.configmakemakeinstall#我没有执行这个安装命令,因为我不需要这个软件。#检测一下编译好的busyboxPATH=./busyboxash#这条命令的作用是清空PATH系统环境变量,防止执行系统目录(/bin/usr/bin等)下的可执行文件如lsrm等。这样,下面的ls命令,是来自busybox的ashshell,而非来自系统的bashshell。/busybox/busybox-1.21.1/build$lsMakefilebusybox_unstripped.outeditorsappletsconsole-toolsfintilsarchivalcoreutilsincludebusyboxdebianutilsinclude2busybox_unstrippeddocsinitbusybox_unstripped.mape2fsprogslibbbmake过程的部分屏幕输出:CCnetworking/ifplugd.oCCnetworking/ifupdown.oCCnetworking/inetd.o#编译networking/inetd.o可以正常通过CCnetworking/interface.oCCutil-linux/volume_id/sysv.oCCutil-linux/volume_id/udf.oCCutil-linux/volume_id/util.oCCutil-linux/volume_id/volume_id.oCCutil-linux/volume_id/xfs.oARutil-linux/volume_id/lib.aLINKbusybox_unstrippedTryinglibraries:cryptmLibrarycryptisnotneeded,excludingitLibrarymisneeded,can'texcludeit(yet)Finallinkwith:mDOCbusybox.podDOCBusyBox.txtDOCbusybox.1DOCBusyBox.html你的问题是找不到头文件,那首先,你检查一下gcc的默认头文件搜索目录echo""|gcc--xc-v-E看输出是否包含/usr/include#include搜索从这里开始:/usr/lib/gcc/i686-linux-gnu/4.6/include/usr/local/include/usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/usr/include/i386-linux-gnu/usr/include根据结果再做下一步判断。