# linux-sources and linux- headers mismatch

## crashman

Why are linux-sources version 2.4.19-r1 and linux-headers are 2.4.18?  I'm trying to learn to write device drivers from the Linux Device Drivers book and the toy program will compile fine, but it won't load due to this version mismatch.

I could unmerge the linux-headers package and symlink to the kernel source, but that would probably get clobbered during an update.

----------

## Malakin

Maybe this explains the errors I had trying to load alsa modules. I didn't care enough to look into it at the time.

----------

## crashman

I fixed my problem by makeing a few defines in the source (__KERNEL__, MODULE) and explicitely pointing to the kernel sources (-I/usr/src/linux/include).  That still doesn't explain the mismatch.  If the includes didn't change between 2.4.18 and 2.4.19 (very likely) there shouldn't be any problem with app compiles, but this may not always be true.  Maybe it's time I learned to write an ebuild and fix this.

----------

## Nitro

 *crashman wrote:*   

>  If the includes didn't change between 2.4.18 and 2.4.19 (very likely) there shouldn't be any problem with app compiles, but this may not always be true.

 

There isn't a 2.4.19 stable kernel out yet, so Gentoo gets a 2.4.19 kernel by applying patches to the stable 2.4.18 source tree.  Probably wanted to stick with stable kernel headers.

----------

## Guest

I think the headers must stay at the same version as they were when GCC (or maybe Glibc, or possibly both) were compiled, which could explain why they are 'only' at version 2.4.18.

----------

## chadh

 *Anonymous wrote:*   

> I think the headers must stay at the same version as they were when GCC (or maybe Glibc, or possibly both) were compiled, which could explain why they are 'only' at version 2.4.18.

 

That is right.  linux-headers should stay the same as those use to compile glibc (per Linus -- google for it).

----------

