Hi,
Just recently I tried to compile a simple driver program or module, hello.c
#define MODULE
#include <linux/module.h>
int init_module(void) { printk("<1>Hello, world\n"); return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }
and the moment I type gcc -c hello.c I get the error
error: linux/module.h: No such file or directory
So i googled out and found that compiling a new kernel by myself might help. I did so with a new kernel on ubuntu but still i am getting the same error.
So i tried to specify the directory of "module.h" in this way->
gcc -I /usr/src/linux-headers-2.6.30-custom/include/ -c hello.c
but then i get a huge no. of errors which consume more then 512 lines of the terminal. Pls. mind that the above directory is the source of the self compiled kernel.
I have tried my best but i can't bust that error out.
Any help is deeply appreciated.
Thank You!!!