700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > linux 内核模块 编译错误 include/linux/mmzone.h:18:26: fatal error: linux/bounds.h: No such file or director

linux 内核模块 编译错误 include/linux/mmzone.h:18:26: fatal error: linux/bounds.h: No such file or director

时间:2022-03-15 09:43:13

相关推荐

linux 内核模块 编译错误  include/linux/mmzone.h:18:26: fatal error: linux/bounds.h: No such file or director

解决方案:内核编译后 不要执行make clean

出现的问题:编译的时候提示缺少头文件 mmzone.h ....bounds.h...等

include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directoryinclude/linux/mmzone.h:197:5: warning: "MAX_NR_ZONES" is not defined

原因:bounds.h是在编译内核时生成的,类似于编译产生的.o文件,如果你运行

"make clean" or "make distclean",这个文件就会被清除掉(详情查看内核Makefile)。因此,如果再利用此内核源码编译内核模块,

如果有涉及bounds.h,就会出现找不到该文件的错误。

解决:独立内核目录之外编译模块时,要确保makefile文件中所定义的内核源代码树已经make过一遍,且没有make clean。这样就不会清除生成的bound.h头文件,这个文件是生成模块必须的。

或者"make prepare"

这样就会重新生成bounds.h,搞定了!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。