kernel source's version.h

On a v11.2 box, I’m installing a development app, Nvidia’s CUDA driver, and due to its required kernel sources and headers and devel packages, well, I went ahead installed every single one available using zypper.

Still this app specifically looks for the version.h file in /usr/src/linux/include/linux, which is a shame, because I seems to have all the header files inside there, except that one.

I know that because I have a v11.3 as well and that file is in there.

I’ve been googling this, but am left wondering why that one file might actually be missing. I don’t know if I should be asking a question like that, as in why? But I thought I’d try.

If you are building a module, it should not be looking fro version.h in /usr/src/linux/include/linux or /usr/include/linux directory.
It should be taken from /lib/modules/uname -r/build/include/linux/version.h
So, when compiling, you should use the following switch:
-I/lib/modules/uname -r/build/include

Great answer syampillai, that cleared it up for me. Many thanks.

Hey there,

If you are interested, you might find the OpenSuse CUDA guide I wrote helpful, it is mentioned in this thread:
NVIDIA CUDA and openSUSE 11.3

I recently updated it for the newer CUDA SDK and OpenSuse 11.3 64-bit

Cheers,
Lews