内核编译错误fatal error: linux/config.h: No such file or

进行内核模块的编译时,因为包含了#include <linux/config.h>,出现include的linux下没有config.h这个文件错误提示:

fatal error: linux/config.h: No such file or directory

原因与解决方法:

现在较新的内核已经弃用了config.h,把这个文件新建上去即可。执行命令(注意路径的不同):

$sudo vim /usr/src/linux-source-2.6.38/include/linux/config.h

输入如下内容:

 #ifndef _LINUX_CONFIG_H
 #define _LINUX_CONFIG_H
 #endif

保存后退出重新编译,OK!

点赞 (4)
  1. fred说道:
    Google Chrome 59.0.3071.115 Google Chrome 59.0.3071.115 Windows 7 Windows 7

    thank you! :surprised:

  2. 16hg说道:

    学这啦!
    [reply=任侠,2012-07-07 03:51 PM]用到神马学神马。[/reply]

  3. 清纯在线说道:

    能编译内核的人都是牛人

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code