views:

323

answers:

1

I'm trying to compile a c programming package (thc-ipv6-0.7) on Linux Redhat 2.6.9-42.ELsmp and it's complaining that it can't find "linux/string.h".

From google, I learned that this is part of the "kernel-headers" package.

If I do "rpm -qa | grep kernel"

It shows that "kernel-devel" is installed (which I think I need), but not "kernel-headers".

A "find / -name string.h" reveals string.h is in fact on the system, in many places, including "/usr/include".

I tried adding "-I/usr/include" to the make file, but got the same error.

My question is, do I need to install "kernel-headers", and if so, where do I find it, and what version?

+2  A: 

Normally, you have to install the version of those headers which correspond to the version of the kernel run by the system on which you'll execute the program. In your case in you want to run locally, 2.6.9-42.

The message complains about "linux/string.h" and not "string.h", so you have add a directory having linux as subdirectory.

I'm not knowledgeable enough about redhat to know how to install them (probably an rpm command) and where they will be installed (with Debian and derivatives put them you have to use -I/usr/src/linux-kernel-version/include").

AProgrammer
Good point about "linux" part of the string.h. The source does specifically as for this.
Jack BeNimble
linux/string.h is completely different from your other string.h, the former is for the string functions used by the kernel, the latter is for the string functions provided by the standard C library.
Robert Gamble
Yeah! It worked! I did find /linux/string.h in a directory named /usr/src/kernels/2.6.9-42.EL-smp-i686/include/. When I put that in the makefile, it compiled. Thanks so much!
Jack BeNimble
Of course, now I get a run-time error - unable to resolve mac address. I'm going to switch to my ubuntu system, because my colleague got it working on that. But, thanks for the tip. That was an annoying error.
Jack BeNimble