RTAI - Can't compile simple.c with gcc (hello world program)
Hello community,
I'm absolutely new to RTAI. I have succesfully installed Ubuntu 7.04 on a Pentium 3
PC.
I have successfully installed RTAI 3.5-Cv with 2.6.20 kernel but I can't compile the classic "Hello World" program.
I created simple.c under directory: /home/mario/hellow
The C code is:
/* simple.c */
#define __KERNEL__
#define MODULE
#include <linux/kernel.h>
#include <linux/module.h>
int init_module(void)
{
printk("hello, world!\n"); /* printk = kernel printf, to the console */
return 0;
}
void cleanup_module(void)
{
printk("goodbye, world!\n");
return;
}
/* end of simple.c */
When I compile with:
gcc -c simple.c
I receive error message:
simple.c:6:26: error: linux/module.h
Obviously compiler is not finding the header file module.h under "linux", since this
is a relative path i did the following:
I created subdirectory "linux" under /home/mario/hellow and copied into there all *.h
files that I found under /usr/src/linux-headers-2.6.20-15/include/linux.
I tried again gcc -c simple.c being my current directory /home/mario/hellow and still
same problem despite the fact that the directory linux with all header files exists
below.
Obviously I am not understanding on what directory I should create the simple.c code.
Can somebody please help?
Thank you so much!
Mario Vallejo
|