LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-01-2004, 05:14 PM   #1
AFI_Flame
Member
 
Registered: Apr 2004
Location: Nolensville, TN
Distribution: OpenSuse 10.2
Posts: 253

Rep: Reputation: 30
What Are Kernel Headers?


I just installed a new kernel for my Slackware 10.0, 2.6.7, and I removed all of the old kernel 2.4.26 stuff including the headers. Now, programs won't compile because I have no headers. How do I get the headers for my new 2.6.7 kernel?
 
Old 07-01-2004, 05:37 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Create a symbolic link called /usr/src/linux, pointing to the actual kernel source root directory. Say, something along these lines: ln -s /usr/src/linux-2.6.7 /usr/src/linux

Kernel headers are include files that define functions that some programs that interact closely with the kernel use.


Håkan
 
Old 07-01-2004, 07:06 PM   #3
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
also as a note: there should be no symlinks to the kernel headers, this can sometimes break programs that try to compile if you switch kernels

/usr/include/linux as well as the other kernel headers should not be symlinks, if it is you might want to remove this,
 
Old 07-01-2004, 08:10 PM   #4
AFI_Flame
Member
 
Registered: Apr 2004
Location: Nolensville, TN
Distribution: OpenSuse 10.2
Posts: 253

Original Poster
Rep: Reputation: 30
Quote:
Create a symbolic link called /usr/src/linux, pointing to the actual kernel source root directory. Say, something along these lines: ln -s /usr/src/linux-2.6.7 /usr/src/linux
I already did that... that's not what the headers are. That's the source code. I'm talking about the files in /usr/include/linux. I just did some test to see exactly what was going wrong and this is what I got. Programs compiled successfully before I did anything (obviously). Then, when I compiled the 2.6.7 kernel they still compiled successfully. Then, I uninstalled the all of the old kernel stuff and the programs would not compile. Then, I reinstalled the 2.4.26 headers and they compiled again. So it seems that the 2.4.26 headers are working with the 2.6.7 kernel somehow. Is this safe to do? And none of you answered my question about how to get the 2.6.7 kernel headers.
 
Old 07-01-2004, 08:32 PM   #5
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
the headers are in the kernel source itself

/usr/src/linux/include/linux and /usr/src/linux/include/asm(pick one, if not sure, then generic should work fine)

this assumes /usr/src/linux is a symlink to the 2.6.7 tree, but be warned, some programs might get errors if you compile against different source headers

just override the headers in /usr/include/linux and /usr/include/asm

those should not be symlinks, if they are, remove them

Last edited by SciYro; 07-01-2004 at 08:33 PM.
 
Old 07-01-2004, 08:36 PM   #6
AFI_Flame
Member
 
Registered: Apr 2004
Location: Nolensville, TN
Distribution: OpenSuse 10.2
Posts: 253

Original Poster
Rep: Reputation: 30
Quote:
but be warned, some programs might get errors if you compile against different source headers
what does that mean? should i use the old 2.4.26 headers on my 2.6.7 kernel or copy the 2.6.7 headers over to /usr/include/linux?
 
Old 07-02-2004, 08:36 AM   #7
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
/usr/include/linux should contain the headers of the kernel that glibc was compiled against. http://lfs.securewebservices.co.uk/l...elheaders.html
 
Old 07-02-2004, 12:38 PM   #8
AFI_Flame
Member
 
Registered: Apr 2004
Location: Nolensville, TN
Distribution: OpenSuse 10.2
Posts: 253

Original Poster
Rep: Reputation: 30
ah ok thanks that's what i wanted to know
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to find/install kernel-source or kernel-headers timsch75 Slackware 3 10-22-2005 09:17 AM
Difference between kernel-headers kernel-source twinkers Debian 2 06-18-2005 11:20 AM
send packets with kernel routing and without kernel messing with headers bassdemon Programming 5 02-08-2005 06:29 PM
Kernel Headers for 2.6 devinWhalen Mandriva 7 04-23-2004 09:35 AM
kernel-headers warmongr Red Hat 6 03-19-2004 11:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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