[PLUG] Compilation problems
Josh Guffin
guffin@physicshouse.dhs.org
Mon, 7 Aug 2000 11:43:19 -0500 (EST)
On Mon, 7 Aug 2000, Jonathan Sergent wrote:
> > The kernel header files usually stay in /usr/src/linux/include so that the
> > current kernel's include files are available to a program requiring them.
>
> That's actually not quite true anymore.
>
> > I'm not sure why everyone seems to be having problems since if you need a
> > include file from the kernel it should always be available in
> > /usr/src/linux/include ... that is the best way to get it since you are
> > suppose to symlink your current kernel's directory to /usr/src/linux
> >
> > Maybe I don't see the problem you guys are having.
> >
> > Copying everything from /usr/src/linux/include to /usr/include is a BAD
> > idea since you'd have to do that everytime you complie a new kernel....
>
> Not actually, because /usr/include/linux is supposed to have the headers
> your C library was built against.
>
> If you just install a new kernel, you should feel free to build it as
> yourself (not as root) in your home directory, and don't make any
> symlinks with /usr/src/linux or anywhere else.
>
> Note that this was not always the case; before libc 6 in particular.
> Your program's compatibility (binary-wise) should not depend on the
> version of the kernel that is booted...
>
> If /usr/include/linux is missing, then you have not installed one or more
> of the packages from your distribution. Red Hat ships a kernel-headers
> package with that in it; Debian ships those files as part of libc6-dev.
> (RH puts them in /usr/src/linux and does the symlinks, but like I say,
> that's just because they have always done it that way).
Yes, i know all my sources are in /usr/src/linux, because that's where i
put them. I've been using 2.2.14 since it came out, and i never had any
problem with compilations linking against the kernel headers. I haven't
used a stock redhat kernel since 5.2
what i've always done is download the kernel source into /usr/src, then
did a tar -xzf. this would give me a 'linux' subdir, which i then moved
to linux-2.x.x. then i added a symlink to that directory called
'linux'.
what tells gcc to look by default in that directory? maybe there's some
configuration glitch going on. i tried to update my egcs packages, but
that had no effect.
also, i didn't just copy everything, i symlinked the files. i dont know
if that's just as bad, but i would assume not.
let me try to explain the problem one more time....
lets say i have a source file like this:
-------
#include <linux/limits.h>
int main() { return 1; }
-------
gcc barfs on this, claiming to not be able to find linux/limits.h
the only way to fix it is to use 'gcc -I/usr/src/linux/include blah.c'
any ideas?
thanks,
josh