jackyopensrc
06-12-2003, 06:07 PM
I have some errors messges during the compilation time.
Please give me some advises! Thanks a lot!
These are my Module codes :
#include<linux/module.h> /*Needed by all modules */
#include<linux/kernel.h> /*Needed for KERN_ALERT */
#define MODULE
int init_module(void)
{
printk("<1> Hello,World 1. \n");
/* A non 0 returns means init_module failed; module */
/* can't be loaded */
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "GoodBYE! \n");
}
Messages returned on my screen:
In file included from hello1.c:3:
/usr/include/linux/module.h:60: parse error before `atomic_t'
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:62: parse error before `}'
/usr/include/linux/module.h:62: warning: data definition has no type or storage class
/usr/include/linux/module.h:91: parse error before `}'
hello1.c: In function `cleanup_module':
hello1.c:21: `KERN_ALERT' undeclared (first use in this function)
hello1.c:21: (Each undeclared identifier is reported only once
hello1.c:21: for each function it appears in.)
hello1.c:21: parse error before string constant
:cool:
Please give me some advises! Thanks a lot!
These are my Module codes :
#include<linux/module.h> /*Needed by all modules */
#include<linux/kernel.h> /*Needed for KERN_ALERT */
#define MODULE
int init_module(void)
{
printk("<1> Hello,World 1. \n");
/* A non 0 returns means init_module failed; module */
/* can't be loaded */
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "GoodBYE! \n");
}
Messages returned on my screen:
In file included from hello1.c:3:
/usr/include/linux/module.h:60: parse error before `atomic_t'
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
/usr/include/linux/module.h:62: parse error before `}'
/usr/include/linux/module.h:62: warning: data definition has no type or storage class
/usr/include/linux/module.h:91: parse error before `}'
hello1.c: In function `cleanup_module':
hello1.c:21: `KERN_ALERT' undeclared (first use in this function)
hello1.c:21: (Each undeclared identifier is reported only once
hello1.c:21: for each function it appears in.)
hello1.c:21: parse error before string constant
:cool: