compiling errors

immortal1015 (immortal1015@hotpop.com)
Wed, 2 Oct 2002 2:53:26 +0800


I tried to compile the very simple kernel module code as following.
I compile this code using gcc -c hello.c, but gcc tell me:
/usr/include/linux /module.h:60 parse error before 'atomic_t'

What is the error? My gcc version is 2.96 and Redhat Linux 7.3

//////////////////////////////////////////////////////////////////////////////
#ifndef __KERNEL__
# define __KERNEL__
#endif
#ifndef MODULE
# define MODULE
#endif
#include <linux/version.h>
#include <linux/config.h>
#include <linux/module.h>

#include <linux/kernel.h> /* printk */

int init_module(void)
{
printk("<1>Hello the world\n");
return 0;
}

void cleanup_module(void)
{
printk("<1>Goodbye the world\n");
}
/////////////////////////////////////////////////////////////////

Best regards
yours Brucie

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