Tech Support > Operating Systems > Linux / Variants > C header files?
C header files?
Posted by Jeff on March 5th, 2004


Hi all-

Trying to install VMware, but get this message:

Trying to find a suitable vmmon module for your running kernel.

None of VMware Workstation's pre-built vmmon modules is suitable for
your running kernel. Do you want this program to try to build the
vmmon module for your system (you need to have a C compiler installed
on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to
override.

What is the location of the directory of C header files that match
your running kernel? [/usr/src/linux/include]

The path "/usr/src/linux/include" is not an existing directory.


Question: Where do these files reside?

Thanks

Posted by Geoff on March 5th, 2004


On Fri, 05 Mar 2004 07:07:06 -0600, Jeff wrote:

<snip>

Your distro may do things differently, but conventionally the "linux" in
that path is a symlink to the sources of your current kernel. Thus if
(eg) linux-2.6.3 is a sub-directory in your /usr/src directory, then you
make the symlink in /usr/src to that directory.

Geoff

Posted by Andreas Janssen on March 5th, 2004


Hello

Jeff (<jwilli@northshorecomputer.net>) wrote:

On most distributions, they are in the kernel-source rpm. On some
distributions, there also is a kernel-headers package. You need to
install it.

best regards
Andreas Janssen

--
Andreas Janssen <andreas.janssen@bigfoot.com>
PGP-Key-ID: 0xDC801674
Registered Linux User #267976
http://www.andreas-janssen.de/debian-tipps.html

Posted by Steve Wolfe on March 5th, 2004


They *should* reside in /usr/include/linux. You're probably also
missing /usr/include/asm as well. Here's what's going on:

/usr/include/linux and /usr/include/asm should have the header files of
the kernel which was used when your C libraries were built, and should
*always* contain that specific set of header files. However, certain
distributions don't do things correctly - they make
/usr/include/{linux|asm} symlinks to /usr/src/linux/{include|asm}. The
problem with that is that when you change your kernel version, the header
files change as well, and that's a bad thing.

Even though the practice of symlinking has been condemned for quite some
time, RedHat took until pretty recently to finally abandon it. Try this:

ls -al /usr/include | egrep "linux|asm"

If your "linux" and "asm" directories are symlinks into /usr/src/linux,
then you need to fix it. Here's how. I'm assuming you are using RedHat,
if you're using a different distro, adjust as necessary. The following
commands are untested and not proof-read, use your own judgement and
common sense.

1. If you don't have it, download the kernel-headers RPM that originally
came with the system, or grab it from your installation media.
2. If you have an existing /usr/src/linux (which, presumably you do),
temporarily move it out of the way:

mv /usr/src/linux /usr/src/linux.tmp

3. Install the kernel-headers RPM:

rpm -i kernel-headers-2.x.y-z.j.i.i386.rpm (replace with the correct
file name)

3. Get rid of the /usr/include symlinks:

rm -f /usr/include/linux
rm -f /usr/include/asm

4. Move over the headers you just installed:

mv /usr/src/linux/include/linux /usr/include/linux
mv /usr/src/linux/include/asm-i386 /usr/include/asm

5. Replace your /usr/src/linux

rm -rf /usr/src/linux
mv /usr/src/linux.tmp /usr/src/linux

steve




Similar Posts