LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-28-2009, 08:10 AM   #1
spyzer.abhishek0
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
Unhappy 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.

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!!!
 
Old 07-29-2009, 07:18 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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 .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ALSA VMALLOC error on driver compilation richcm Linux - Hardware 2 01-19-2008 07:45 PM
Guide needed in device driver / module compilation. SPo2 Linux - Newbie 1 09-30-2007 12:18 PM
FD Device Driver Error NeoKaiserSigma Linux - Laptop and Netbook 10 08-27-2004 08:16 AM
Device Driver Compilation on 9.0 softcse Linux - Software 1 08-21-2004 12:03 PM
alsa driver compilation error darkleaf Linux - Software 4 07-08-2004 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration