LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-07-2008, 09:08 AM   #1
muskvar
Member
 
Registered: May 2007
Posts: 54

Rep: Reputation: 15
Linux Kernel Module programming compilation errors.


Hi All,

I wanted to get started with writing kernel modules, I found the following link:http://www.linuxtopia.org/online_boo..._2.6/x121.html which gives a sample program and a Makefile for the same.

When i type make hello-1, I get the following error:
make hello-1
cc hello-1.c -o hello-1
hello-1.c:4:60: error: linux/module.h: No such file or directory
hello-1.c: In function ‘init_module’:
hello-1.c:9: error: ‘KERN_INFO’ undeclared (first use in this function)
hello-1.c:9: error: (Each undeclared identifier is reported only once
hello-1.c:9: error: for each function it appears in.)
hello-1.c: In function ‘cleanup_module’:
hello-1.c:19: error: ‘KERN_INFO’ undeclared (first use in this function)
make: *** [hello-1] Error 1,
Now if I put module.h into /usr/src/linux, it inturn depends of three other headers.
My kernel version is:2.6.24-19-generic

Please, Can anybody guide/help me.

Thanks in advance.
 
Old 12-08-2008, 03:04 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: Slackware64 13.37, Kubuntu 10.04
Posts: 2,944

Rep: Reputation: Disabled
Do you have a kernel headers package installed, or just the source package?
ta0kira
 
Old 12-08-2008, 09:58 AM   #3
muskvar
Member
 
Registered: May 2007
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks, I resolved the issue just now, I looked at the instructions inside Documentation/Kbuild/modules.txt and it worked like a charm.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hello friends there is problem in linux kernel module compilation. kapilaryan2003 Mandriva 1 06-10-2008 08:07 AM
Inside linux kernel module compilation and loading nandac Programming 5 03-12-2007 12:55 PM
Linux Kernel Module Programming astronaut3000 Linux - Software 1 09-23-2005 02:02 AM
Linux kernel module programming(Signal and semaphore) eshwar_ind Programming 1 02-16-2004 12:10 PM


All times are GMT -5. The time now is 04:53 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration