我是初学者,我正在
linux中尝试一些内核编程的基础知识.今天早上,我已经在VIM中打开了module.h文件,并关闭了它,也没有保存任何更改.之后,我无法编译我的任何代码.我收到以下错误消息
[root@localhost helloworld]# cc helloworld.c
helloworld.c:1:25: error: linux/module.h: No such file or directory
[root@localhost helloworld]#
这是一个直到最后一天运行成功的示例代码.
#include
#include
int init_module(void)
{
printk("HELLO WORLD");
return 0;
}
void cleanup_module(void)
{
printk("GOODBYE");
}
我搜索了module.h文件,如下所示,它确实存在
[root@localhost usr]# find . -name module.h
./src/kernels/2.6.18-194.el5-i686/include/asm-x86_64/module.h
./src/kernels/2.6.18-194.el5-i686/include/asm-i386/module.h
./src/kernels/2.6.18-194.el5-i686/include/linux/module.h
./include/sepol/policydb/module.h
./include/sepol/module.h
./include/kde/kunittest/module.h
[root@localhost usr]#
请帮我出来
我在虚拟框中使用CentOS.
本文档记录了一位初学者在CentOS上遇到的Linux内核模块编译问题。主要问题是尽管module.h文件存在,但在编译过程中仍报告找不到该文件。通过详细描述问题背景及提供的解决方案,帮助读者理解并解决类似问题。
1万+

被折叠的 条评论
为什么被折叠?



