|
xdkui@XDKUI:~$ cat hello.c
/*
* $Id: hello.c,v 1.10 2001/07/17 10:30:02 rubini Exp $
*/
#define __KERNEL__
#define MODULE
#include <linux/module.h>
/*
* These lines, although not shown in the book,
* are needed to make hello.c run properly even when
* your kernel has version support enabled
*/
int init_module(void) { printk("<1>Hello, world\n"); return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }
编译
gcc -c hello.c
出来一大堆错误,……………………
/usr/include/linux/stat.h:68: error: storage size of `atime' isn't known
/usr/include/linux/stat.h:69: error: storage size of `mtime' isn't known
/usr/include/linux/stat.h:70: error: storage size of `ctime' isn't know
请问是为什么阿?是不是还要包含一个类型定义头文件? |
|