QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1279|回复: 1

求助(急)!!

[复制链接]
发表于 2005-10-27 23:03:20 | 显示全部楼层 |阅读模式
本人在调试模块时出现以下错误提示:
hello.c: In function `init_module':
hello.c:15: warning: implicit declaration of function `printk'

请教各位大师如何解决!!先谢了。

附代码:
#ifndef __KERNEL__
        #define __KERNEL__
#endif
#ifndef MODULE
        #define MODULE
#endif

#include "linux/version.h"
#include "linux/init.h"
#include "linux/module.h"
#include "linux/kernel.h"

int init_module()
{
        printk("hello world!\n");
        return 0;
}

void cleanup()
{
        printk("I will shut down in kernerl!\n");
}

MODULE_LICENSE("GPL");

MODULE_AUTHOR("feng");



编译语句为:
gcc -Wall-DMODULE -D__KERNEL__ -O2 -I /usr/include -c hello.c
 楼主| 发表于 2005-10-27 23:04:20 | 显示全部楼层
请各位大师指点
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-6 07:41 , Processed in 0.052349 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表