LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Which version.h is being used ? (http://www.linuxquestions.org/questions/programming-9/which-version-h-is-being-used-891285/)

goossen 07-12-2011 08: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:
Code:

#include <linux/version.h>
and
Code:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
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 12: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 05: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 01:29 PM.