linux/module.h: No such file or directory 内核模块编译过程
1、缺少Linux kernel头文件
To install just the headers in Ubuntu:
| sudo apt-get install linux-headers-$(uname -r) |
To install the entire Linux kernel source in Ubuntu:
| sudo apt-get install linux-source |
Note that you should use the kernel headers that match the kernel you are running.
2、内核模块编译过程ubuntu
源码 hello.c :
#include <linux/init.h>
#include <linux/module.h> MODULE_LICENSE("Dual BSD/GPL"); static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
} static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
} module_init(hello_init);
module_exit(hello_exit);
Makefile文件
# at first type on ur terminal that $(uname -r) then u will get the version..
# that is using on ur system obj-m += hello.o KDIR =/usr/src/linux-headers-$(shell uname -r) all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules clean:
rm -rf *.o *.ko *.mod.* *.symvers *.order
内核模块运行:
$ sudo insmod hello.ko
$ dmesg ==> u will get the output
$ sudo rmmod hello
$ dmesg
参考链接:http://stackoverflow.com/questions/16919512/linux-module-h-no-such-file-or-directory
linux/module.h: No such file or directory 内核模块编译过程的更多相关文章
- fatal error: linux/videodev.h: No such file or directory
Run Build Command:"/usr/bin/make" "cmTC_162a3/fast"/usr/bin/make -f CMakeFiles/c ...
- linux/videodev.h: No such file or directory错误解决方法
sudo apt-get install libv4l-dev* file yum install libv4l-dev* yum install libv4l-dev* 上面错误的问题是两个2.4以 ...
- linux e2fsprogs安装解决uuid/uuid.h: No such file or directory错误
linux查看某个包是否安装 dpkg -l libuu* 用gcc编译发生nux 错误:fatal error: uuid/uuid.h: No such file or directo ...
- Linux安装redis报错:jemalloc/jemalloc.h: No such file or directory踩坑
报错内容: 针对这个错误,我们可以在README.md 文件中看到解释: --------- Selecting a non-default memory allocator when buildin ...
- linux服务器安装pyspide关于rgnutls.h: No such file or directory 的解决方案
In file included from src/docstrings.c:4:0: src/pycurl.h:148:30: fatal error: gnutls/gnutls.h: No su ...
- 【转】stropts.h: No such file or directory – How to Fix
原文地址:stropts.h: No such file or directory – How to Fix 作者:xjc2694 It is a known issue that modern Li ...
- jemalloc/jemalloc.h: No such file or directory
Redis 2.6.9 安装报错,提示: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directoryzmalloc.h ...
- CentOS: make menuconfig error: curses.h: No such file or directory
the problem when use centos5 to build kernel or busybox step 1. Centos中关于 ncurses.h:no such file or ...
- lua.c:80:31: fatal error: readline/readline.h: No such file or directory
make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...
随机推荐
- hdu 4908 BestCoder Sequence
# include <stdio.h> # include <algorithm> using namespace std; int main() { int n,m,i,su ...
- Android系统进程Zygote启动过程的源代码分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6768304 在Android系统中,所有的应用 ...
- iOS之Swift语言的学习
好久都没有来这个熟悉而又陌生的地方啦, 想想已经有两三个月了吧,不过我相信以后还是会经常来的啦,因为忙碌的学习已经过去啦,剩下的就是要好好的总结好好的复习了,好好的熟悉下我们之前学习的知识点,将他们有 ...
- windows下常用的操作命令及dos命令
常用windows运行命令mstsc---远程桌面连接regedit.exe---打开注册表services.msc---打开服务管理器rsop.msc---组策略结果集taskmgr---任务管理器 ...
- IOS 中关于自定义Cell 上的按钮 开关等点击事件的实现方法(代理)
1.在自定义的Cell .h文件中写出代理,写出代理方法. @protocol selectButtonDelegate <NSObject> -(void)selectModelID:( ...
- Spark RDD设计学习笔记
本文档是学习RDD经典论文<Resilient Distributed Datasets: A Fault-Tolerant Abstraction for In-Memory Cluster ...
- Spark IDEA开发环境构建
本文档基于IEDA构建spark maven应用. date: 2016/8/1 author: wangxl 1.下载IDEA https://www.jetbrains.com/idea/ 2.安 ...
- thinkphp3.2之模型(M层)
最近学习了php框架thinkphp,回头总结了些学习心得知识,希望对大家有帮助 1.模型的概念: 模型(Model)是 ThinkPHP 中一个很重要的概念,粗略的理解模型就是与数据库交互信息进行c ...
- JAVA操作properties文件
va中的properties文件是一种配置文件,主要用于表达配置信息,文件类型为*.properties,格式为文本文件,文件的内容是格式是"键=值"的格式,在properties ...
- css元素隐藏(display:none和visibility:hidden)
在css中, display:none和visibility:hidden都能够使元素隐藏.但是两者所带来的效果完全不同. css display:none 当使用该样式的时候,HTML元素的宽高等 ...