|
发表于 2005-7-27 09:47:11
|
显示全部楼层
Post by smego
编译时出现了这样的错误,
make CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i386 " -C kernel
make[1]: Entering directory `/usr/src/linux-2.4.24/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.4.24/kernel'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i386 -nostdinc -iwithprefix include -DKBUILD_BASENAME=sched -fno-omit-frame-pointer -c -o sched.o sched.c
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/usr/src/linux-2.4.24/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/usr/src/linux-2.4.24/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:409: error: conflicting types for 'schedule_timeout'
打开这个文件看看,第一个错误发生在这里,
210 static FASTCALL(void reschedule_idle(struct task_struct * p));
211
212 static void reschedule_idle(struct task_struct * p)
213 {
214 #ifdef CONFIG_SMP
215 int this_cpu = smp_processor_id();
216 struct task_struct *tsk, *target_tsk;
217 int cpu, best_cpu, i, max_prio;
218 cycles_t oldest_idle;
219
按来说 这样没有什么问题呀 并没有重复定义,前一次只是声明而已。
我用的是debian下的gcc-3.4编译,大家看这是什么问题?是我的gcc不够新?
呵呵,估计是gcc太新了,而不是不够新
另外你的编译参数真多,尝试去掉一些限制看看,比如-Wstrict-prototypes |
|