当前位置: 技术问答>linux和unix
编译驱动出错
来源: 互联网 发布时间:2016-02-08
本文导语: 编译了一个驱动程序,出现了下面的错误: gcc -c -I /usr/src/linux-2.4/include -D__KERNEL__ -D__MODULE__ -o test.o test.c In file included from /usr/src/linux-2.4/include/linux/prefetch.h:13, from /usr/src/linux-2....
编译了一个驱动程序,出现了下面的错误:
gcc -c -I /usr/src/linux-2.4/include -D__KERNEL__ -D__MODULE__ -o test.o test.c
In file included from /usr/src/linux-2.4/include/linux/prefetch.h:13,
from /usr/src/linux-2.4/include/linux/list.h:6,
from /usr/src/linux-2.4/include/linux/module.h:12,
from test.c:2:
/usr/src/linux-2.4/include/asm/processor.h:65: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
/usr/src/linux-2.4/include/asm/processor.h:65: requested alignment is not a constant
make: *** [test.o] Error 1
哪位能够解决CONFIG_X86_L1_CACHE_SHIFT没有定义的问题啊?
gcc -c -I /usr/src/linux-2.4/include -D__KERNEL__ -D__MODULE__ -o test.o test.c
In file included from /usr/src/linux-2.4/include/linux/prefetch.h:13,
from /usr/src/linux-2.4/include/linux/list.h:6,
from /usr/src/linux-2.4/include/linux/module.h:12,
from test.c:2:
/usr/src/linux-2.4/include/asm/processor.h:65: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
/usr/src/linux-2.4/include/asm/processor.h:65: requested alignment is not a constant
make: *** [test.o] Error 1
哪位能够解决CONFIG_X86_L1_CACHE_SHIFT没有定义的问题啊?
|
另外就是直接把CONFIG_X86_L1_CACHE_SHIFT=7加到.config文件中,由参考/usr/src/linux/arch/i386/defconfig:CONFIG_X86_L1_CACHE_SHIFT=7得.
make menuconfig
再看看/usr/src/linux/include/linux/autoconf.h中定义有下面的宏
#define CONFIG_X86_L1_CACHE_SHIFT 7