--- In [email protected], saurabh jain <[EMAIL PROTECTED]> wrote:
>
> Hi,
>   I was trying to compile a simple prog....
> 
> /* snippet */
> 
> #define MODULE
> #include <signal.h>
> #include <linux/module.h>
> 
> int init_module (void) /* Loads a module in the kernel */
> {
>         printk("Loading module \n");
>         return 0;
> }
> 
> void cleanup_module(void) /* Removes module from kernel */
> {
>         printk("Unloaded waste module \n");
> }
> 
> /* End Code*/
> 
> When I try to compile this with gcc -c filename.c
> I get following errors.....
> /usr/include/linux/time.h:9: error: redefinition of ¡struct timespec¢
> /usr/include/linux/time.h:15: error: redefinition of ¡struct timeval¢
> /usr/include/linux/time.h:20: error: redefinition of ¡struct timezone¢
> /usr/include/linux/time.h:47: error: redefinition of ¡struct itimerval¢
> In file included from filename.c :3:
> /usr/include/linux/module.h:41: error: field ¡attr¢ has incomplete type
> /usr/include/linux/module.h:49: error: field ¡kobj¢ has incomplete type
> 

Just remove the headers and then try compiling it will work fine!!

Thanks 
Saurabh :)


Reply via email to