I still got same error when using
-I/lib/modules/`uname -r`/build/include flag in compilation instead of -I/usr/src/linux/include
I am compiling a standalone device driver, not add the driver to kernel. Here is full message:
[root@puma wish-1.6.2]# make
/usr/src/linux/scripts/mkdep -- *.c > .depend
/usr/src/linux/scripts/mkdep -- *.h > .hdepend
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -DMODULE -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h -nostdinc -iwithprefix include -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=x10_core -c -o x10_core.o x10_core.c
x10_core.c:1:24: /usr/src/linux/include/linux/modversions.h: No such file or directory
In file included from x10_core.c:46:
/usr/src/linux/include/linux/config.h:4:28: linux/autoconf.h: No such file or directory
In file included from /usr/src/linux/include/linux/prefetch.h:13,
from /usr/src/linux/include/linux/list.h:6,
from /usr/src/linux/include/linux/module.h:12,
from x10_core.c:53:
/usr/src/linux/include/asm/processor.h:56: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
/usr/src/linux/include/asm/processor.h:56: requested alignment is not a constant
In file included from x10_core.c:53:
/usr/src/linux/include/linux/module.h:297:27: linux/version.h: No such file or directory
In file included from x10_core.c:53:
/usr/src/linux/include/linux/module.h:299: parse error before `UTS_RELEASE'
x10_core.c:67:27: linux/version.h: No such file or directory
make: *** [x10_core.o] Error 1
What could be wrong here. Thanks Arjan,
-Hong
Arjan van de Ven wrote:
On Fri, 2003-05-09 at 17:57, Hong Hsu wrote:When compiling a device driver, I got the error which said the /usr/src/linux/include/linux/config.h couldn't find linux/autoconf.h However, the autoconf.h is there! What could be the problem here?you're using the glibc headers to compile kernel code, that's not going to work. Add -I/lib/modules/`uname -r`/build/include to your compiler flags to point it to kerenl headers.