public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* compiling errors
@ 2002-10-01 18:07 immortal1015
  2002-10-01 18:22 ` Arjan van de Ven
  0 siblings, 1 reply; 4+ messages in thread
From: immortal1015 @ 2002-10-01 18:07 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

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.


//////////////////////////////////////////////////////////////////////////////
#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





^ permalink raw reply	[flat|nested] 4+ messages in thread
* compiling errors
@ 2002-10-01 18:53 immortal1015
  2002-10-01 19:20 ` Richard B. Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: immortal1015 @ 2002-10-01 18:53 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-01 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-01 18:07 compiling errors immortal1015
2002-10-01 18:22 ` Arjan van de Ven
  -- strict thread matches above, loose matches on Subject: below --
2002-10-01 18:53 immortal1015
2002-10-01 19:20 ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox