LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Device Driver Compilation Error!!! (https://www.linuxquestions.org/questions/linux-kernel-70/device-driver-compilation-error-743367/)

spyzer.abhishek0 07-28-2009 08:10 AM

Device Driver Compilation Error!!!
 
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.:confused:

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!!!

John VV 07-29-2009 07:18 PM

WHAT version of linux are you using ?
that file is in the kernel-devel.rpm on fedora 11
and is located here --- for fedora ---
/lib/modules/2.6.29.6-213.fc11.i586/source/include/linux

there is no need to compile a new kernel , unless you RELAY WANT TO .


All times are GMT -5. The time now is 07:48 AM.