|
楼主 |
发表于 2003-5-7 23:04:39
|
显示全部楼层
问题是这样的:写了个最小模块,编译后安装时出现顶楼的错误,
所以重新编译内核,结果这段代码编译不过去了:
#define MODULE
#include <linux/module.h>
int init_module(void)
{
pinntk("<1> Hello, world\n");
return 0;
}
void cleanup_module(void)
{
printk("<1>goodbye cruel world\n");
return;
}
看错误:
[root@linuxer drv]# gcc -o drv drv.c
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
/tmp/ccWjIWsR.o(.text+0xf): In function `init_module':
: undefined reference to `pinntk'
/tmp/ccWjIWsR.o(.text+0x2c): In function `cleanup_module':
: undefined reference to `printk'
collect2: ld returned 1 exit status |
|