LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
Search this Thread
Old 01-27-2009, 08:27 AM   #1
sagitalk
Member
 
Registered: Aug 2008
Posts: 38

Rep: Reputation: 15
missing header files


i am trying to write a simple device driver

filename:dd.c

#include <linux/module.h>
#include<linux/kernel.h>
#include<sys/resource.h>
#include<signal.h>

int init_module (void) /* Loads a module in the kernel */
{
printk("Hello kernel n");
return 0;
}

void cleanup_module(void) /* Removes module from kernel */
{
printk("GoodBye Kerneln");
}



i compiled it as follows: gcc -c dd.c


i am getting the following errors:

In file included from /usr/include/linux/sched.h:16,
from /usr/include/linux/module.h:9,
from dd.c:2:
/usr/include/linux/signal.h:2:2: warning: #warning "You should include <signal.h>. This time I will do it for you."
In file included from /usr/include/linux/sched.h:79,
from /usr/include/linux/module.h:9,
from dd.c:2:
/usr/include/linux/resource.h:2:2: warning: #warning "You should include <sys/resource.h>. This time I will do it for you."
In file included from /usr/include/linux/module.h:10,
from dd.c:2:
/usr/include/linux/cache.h:5:23: error: asm/cache.h: No such file or directory
In file included from dd.c:2:
/usr/include/linux/module.h:41: error: field ‘attr’ has incomplete type
/usr/include/linux/module.h:49: error: field ‘kobj’ has incomplete type



please help me out
 
Old 01-27-2009, 08:35 AM   #2
sagitalk
Member
 
Registered: Aug 2008
Posts: 38

Original Poster
Rep: Reputation: 15
i tried the following

yum -y install gcc gcc-c++ kernel-devel

but still the problem persists

i am using 2.6.18-8.el5 redhat enterprise linux

then i downloaded linux-libc-headers-2.6.12.0.tar.bz2

i extracted the package and copy pasted the contents of
linux-libc-headers-2.6.12.0/include/linux to /usr/include/linux

but still it doesnt work
 
Old 01-27-2009, 08:35 AM   #3
sagitalk
Member
 
Registered: Aug 2008
Posts: 38

Original Poster
Rep: Reputation: 15
i tried the following

yum -y install gcc gcc-c++ kernel-devel

but still the problem persists

i am using 2.6.18-8.el5 redhat enterprise linux

then i downloaded linux-libc-headers-2.6.12.0.tar.bz2

i extracted the package and copy pasted the contents of
linux-libc-headers-2.6.12.0/include/linux to /usr/include/linux

but still it doesnt work
 
Old 01-27-2009, 08:49 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,503

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
On my RHEL4 box the file /usr/include/asm/cache.h is provided by the package glibc-kernheaders. Try to see if there is a similar one on RHEL5.
 
  


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
C Header files missing in /usr/include zorro_kwh Ubuntu 3 04-12-2008 06:57 PM
missing header files on kubuntu 7.04 guardian_shadow Linux - Newbie 4 08-12-2007 04:23 PM
missing header files and vmware trscookie Linux - Software 7 03-13-2007 04:10 AM
Qt4 missing header files SPo2 Programming 2 01-20-2007 04:36 PM
Missing C header files? kushalkoolwal Programming 3 11-07-2005 04:52 AM


All times are GMT -5. The time now is 09:09 PM.

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 Google+: linuxquestions
Open Source Consulting | Domain Registration