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 ...
随机推荐
- 将字符串变成大写----C++实现
虽然这个题目很简单,但是也是会范很多错误的,平时你肯定知道,但是在编程的时候就是容易犯傻,而且八匹马都拽不回来... 看来还是要多写写代码..不废话了. 直接贴代码.. #include<ios ...
- java遍历泛型的方法
一.List遍历 Java中List遍历有三种方法来遍历泛型,主要为: 1.for循环遍历 2.iterator遍历 3.foreach遍历 package com.gmail.lsgjzhuwei; ...
- 文章转载至CSDN社区罗升阳的安卓之旅,原文地址:
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6720261 前面我们在分析Activity启动 ...
- Win7刷新环境变量
在“我的电脑”->“属性”->“高级”->“环境变量”中增加或修改环境变量后,需重启系统才能使之生效.有没有什么方法可让它即时生效呢? 下面介绍一种方法: 以修改环境变量“PATH” ...
- OpenCV——像素数据类型总结<摘>
1.Unsigned 8bits(一般的图像文件格式使用的大小)IplImage数据结构参数:IPL_DEPTH_8UCvMat数据结构参数:CV_8UC1,CV_8UC2,CV_8UC3,CV_8U ...
- web.xml中classpath:和classpath*: 有什么区别?
web.xml中classpath:和classpath*: IccBoY applicationContext.xml 配置文件的存放位置 web.xml中classpath:和classp ...
- php过滤iphone的emoji表情
public static function removeEmoji($text) { $clean_text = ""; // Match Emoticons $regexEmo ...
- zabbix之1监控概念
1.通过通用的snmp监控,无需代理端 2.通过snmp代理 snmp代理的工作原理:在被监控端设置代理,代理不断的获取本地数据,而管理端定期通过代理获取监控数据. snmp目前有v1,v2,v3三种 ...
- Ubuntu安装字体的方法
基本步骤如下: 1. 将要安装的字体放在一个文件夹下,以/home/UsrName/Download/Font为例 2.在终端中输入 sudo cp -r /home/UsrName/Download ...
- Spring3.0.5 获取表中自增的主键(mysql)
public int addWsstxCotent(final WsstxContent wsstxContent) { final String sql = "insert into ws ...