论坛风格切换切换到宽版
  • 847阅读
  • 3回复

[问题求助][红旗] 升级完内核编译个文件有错,请大家帮我找找原因 [复制链接]

上一主题 下一主题
离线yuxing4.
 
发帖
2157
C币
-198889
威望
368
贡献值
1
银元
-1
铜钱
4736
人人网人气币
0
只看楼主 正序阅读 使用道具 楼主  发表于: 2009-05-01
今天才升级完内核,编译.h.ello.c文件,源程序如下:              乙肝
#include <linux/in.it.h>           鲜花

#include <.linux/module.h>             电子

MODULE_L.ICENSE("GPL");   //General Pu.blic License           鲜花
stat.ic int hello_init(.void).

{
pr.intk(KERN_ALERT "He.llo, world\n");电影
return 0;
}
sta.tic voi.d hello_exit(void)健康
{
printk(.KERN_ALERT"Good.bye world\n");             电子
}
module_init(hell.o_init);.

module_.exit(hello_exit);.

编译出现如下错误,不知道如何解决,.高手帮帮我:--- 印刷
hello..c:1:2.4: error: linux/init.h: 没有那个文件或目录
hello.c:3:26:. error: linux/module..h: 没有那个文件或目录.
hello.c:5:. error: expected declar.ation sp.ecifiers or ‘...’ before string constant.
hello.c:5: warning: dat.a definition has no type or st.orage class投资
h.ello.c: In func.tion ‘hello_init’:.
hello.c:13: error: ‘KERN_ALERT’ undeclared (first use in this f.u.nction)    外汇
h.ello.c:13: error: (Each undeclared identif.ier is reported only once--------------彩票
hello.c:13: error: for each function .i.t appears in.)           女人
hello.c:13.: error: expect.ed ‘)’ before string constant(        游戏          )
h.ello.c: In function ‘hello_exit.’:.
hello.c:.25: error: ‘K.ERN_ALERT’ undeclared (first use in this function)域名
hello.c:25: error: expected ‘)’ befor.e .string constant.
hello.c: At top .level:投资
hello.c:31: warning: data definition has no ty.pe or storage. class.
hello.c:31: warning: parameter name.s (without types) in. f.unction declaration投资
hel.lo.c:33: wa.rning: data definition has no type or storage class电影
hello.c:.33: warning: parameter names (without types) in fun.c.tion declaration虚拟主机

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线灯笼芯.
发帖
2157
C币
-593606
威望
401
贡献值
2
银元
-4
铜钱
4843
人人网人气币
0
只看该作者 地板  发表于: 2010-04-14
Re:[红旗]
你是怎么编译的呢?
离线pchhh.
发帖
1960
C币
-235489
威望
365
贡献值
1
银元
0
铜钱
4343
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-14
Re:[红旗]
我觉的是配置时环境变量的问题

离线5842136.
发帖
2262
C币
-192932
威望
414
贡献值
1
银元
-2
铜钱
5064
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-14
Re:[红旗]
没有安装内核头文件,要不就是搜索头文件的路径不对

快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个