Small problem, Can anybody help me?

From: Srinivas G.
Date: Thu May 06 2004 - 09:09:42 EST



Hi,

I have written a small hello.c program in the Linux Kernel version
2.4.18-3.

The code is as follows.
-----------------------


define MODULE
#include <linux/module.h>
#include <linux/init.h>

MODULE_LICENSE("GPL");

int Test_init(void)
{
printk("<1> Hello World\n");
return 0;
}

void Test_cleanup(void)
{
printk("<1> Good bye\n");
}

module_init(Test_init);
module_exit(Test_cleanup);


I compiled it under same kernel version that is 2.4.18-3. It was showing
the following errors.

In file included from hello.c:2:
/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 `}'


The errors came due to a mistake in linux header file. Is it so...

Thanks in advance for any help you can come up with.

Regards,

Srinivas G




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/