-   Programming (
-   -   Which version.h is being used ? (

goossen 07-12-2011 09:12 AM

Which version.h is being used ?
I have a machine which came with the kernel 2.6.18, I've compiled from source a newer kernel (2.6.35) because the patches I'm working on are intended for that version.
I have several of lines like this:

#include <linux/version.h>

These values are defined in version.h but how can I tell to (or know if it) use /opt/kernel/linux-2.6.35/include/linux/version.h instead of /usr/include/linux.version.h (which is 2.6.18) ?

Or am I missing some step related to kernel upgrade ?

CapnStank 07-12-2011 01:16 PM

See this post. Basically the .h file located first in your include path is used.

I *believe* you can use `gcc -v` to see your include path but I forget and don't have access to gcc compiler where I am right now.

Peverel 07-13-2011 06:57 AM

I suggest you read the file \usr\include\linux\version.h ; it appears to tell you what to do.

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