当前位置: 技术问答>linux和unix
请教一个驱动编译的问题
来源: 互联网 发布时间:2015-10-19
本文导语: 我仿写了一个字符设备驱动程序,用gcc -c trace.c -D_KERNEL_ -DMODULE -O2 -I/usr/src/linux-2.4.20-8/include -g -Wall -o trace.o2 进行编译。 报错是: In file included from /usr/src/linux-2.4.20-8/include/linux/sched.h:16, ...
我仿写了一个字符设备驱动程序,用gcc -c trace.c -D_KERNEL_ -DMODULE -O2 -I/usr/src/linux-2.4.20-8/include -g -Wall -o trace.o2 进行编译。
报错是:
In file included from /usr/src/linux-2.4.20-8/include/linux/sched.h:16,
from /usr/src/linux-2.4.20-8/include/asm/uaccess.h:8,
from trace.c:11:
/usr/src/linux-2.4.20-8/include/linux/timex.h:173: field `time' has incomplete
type
/usr/src/linux-2.4.20-8/include/linux/timex.h:188: confused by earlier errors,
bailing out
请问这个问题如何解决啊?
报错是:
In file included from /usr/src/linux-2.4.20-8/include/linux/sched.h:16,
from /usr/src/linux-2.4.20-8/include/asm/uaccess.h:8,
from trace.c:11:
/usr/src/linux-2.4.20-8/include/linux/timex.h:173: field `time' has incomplete
type
/usr/src/linux-2.4.20-8/include/linux/timex.h:188: confused by earlier errors,
bailing out
请问这个问题如何解决啊?
|
你打错了,应该是:
-D__KERNEL__,不是-D_KERNEL_
-D__KERNEL__,不是-D_KERNEL_