LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-26-2009, 10:19 AM   #1
clarkshiraz
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
Unhappy invalid file or directory:#include<linux/module.h>


sos!!

i am getting this error when i try to compile my driver module.

i compiled by "make" but getting invalid header file error for <linux/module.h> and <linux/init.h>and these files are highlighted in orange color in the vim editor....so what does it mean??

plz reply soon....

Last edited by clarkshiraz; 09-27-2009 at 12:05 AM.
 
Old 09-26-2009, 08:35 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Buster (Fluxbox WM)
Posts: 1,390
Blog Entries: 52

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
Have you installed the linux header files for your kernel?

What is the include path in your makefile?
 
Old 09-27-2009, 12:29 AM   #3
clarkshiraz
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Original Poster
Rep: Reputation: 0
well all the header files for kernel are there in /usr/src/2.6.18.../kernel/include and the makefile path :

obj-m +=hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

1)for <linuix/module.h> and <linux/init.h> the gcc compiler is showing:invalid file or directory except <linux/kernel.h>
2) in vim editor the 'include' of 'include<linux/module.h>' is highlighted in orange color for all headers.


can u suggest something????
 
Old 09-27-2009, 06:01 AM   #4
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Buster (Fluxbox WM)
Posts: 1,390
Blog Entries: 52

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
You may need to make a symbolic link so that the include files can be found, eg:

Code:
ln -s /usr/src/linux-headers-2.6.18... /usr/src/linux
though it seems odd that it would find the kernel.h header and not the other two. The kernel include files are in /usr/src/linux/include/linux/.

I'm also unsure about the orange highlight. That sounds more like a syntax error. Is it possible to post the first part of the source code for the module (up to and including the include statements)? And post the exact error messages from the compilation?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
PHP include file directory/paths DMeerholz Linux - Software 1 07-02-2007 10:21 AM
/usr/include/rpm: No such file or directory powah Red Hat 3 10-31-2006 10:27 AM
#include <task.h> : No such file or directory Eileen Programming 1 04-20-2006 03:26 AM
'Invalid module format' loading simple module on Suse Linux Professional 9.1 rocketdude Linux - Distributions 3 07-27-2004 11:40 PM

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

All times are GMT -5. The time now is 02:46 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