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 内核模块编译过程的更多相关文章

  1. 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 ...

  2. 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以 ...

  3. 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 ...

  4. Linux安装redis报错:jemalloc/jemalloc.h: No such file or directory踩坑

    报错内容: 针对这个错误,我们可以在README.md 文件中看到解释: --------- Selecting a non-default memory allocator when buildin ...

  5. 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 ...

  6. 【转】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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. The account is locked

    SQL> select * from v$version where rownum=1; BANNER --------------------------------------------- ...

  2. UDK——入门开发流程

    1.入门级參考UnrealScript代码 UnrealScript模仿JAVA,可是又有巨大的不同,主要是它本身具有完好的结构,貌似UDK把一切都安排好了,就像在盖楼一样.面对一幢已经完工的设计静止 ...

  3. html5 video播放不全屏

    <video controls="controls" webkit-playsinline src="${page.videoUrl }" type=&q ...

  4. CSS彻底研究(1)

    Github pages 博文 基本选择器 标记选择器h1 {...} 类别.class_name{...},两个class同时作用,如class = 'one two',冲突取前者 ID选择器 #i ...

  5. js实现的对象数组根据对象的键值进行排序代码

    有时候会遇到做展示数组的排序,由大到小和由小到大的切换: var arr=[{id:1,webName:"蚂蚁部落"},{id:2,webName:"网易"}] ...

  6. HTML - Textarea - 空格的问题解决方式

    第一种方式: <textarea name="textareaname" rows="XX" cols="XX" ></t ...

  7. javascript 模仿回车键事件

    <script> $(function(){ var _login = function (){ var _name = $('#name'); var _password = $('#p ...

  8. MJRefresh(上拉加载下拉刷新)

    整理自:https://github.com/CoderMJLee/MJRefresh#%E6%94%AF%E6%8C%81%E5%93%AA%E4%BA%9B%E6%8E%A7%E4%BB%B6%E ...

  9. 编译错误“The run destination My Mac 64-bit is not valid for Running the scheme '***',解决办法

    1. iOS APP Project or  Mac APP Project编译错误提示:
“The run destination My Mac 64-bit is not valid for Ru ...

  10. mysql 5.7占用400M内存优化方案

    mysql出问题了,装了一下新版本,竟然占用400多M的内存,这对于不是服务器,占用是在太高了,再开打一个开发工具,那电脑很卡了,其实是可以优化一下的,在my.ini文件找到这几个参数更改一下,占用大 ...