当前位置: 技术问答>linux和unix
请教驱动程序交叉编译问题(初学)
来源: 互联网 发布时间:2015-07-11
本文导语: 我要做的是把驱动程序编译后下载到arm开发板上。我用的是三星的s3c2410x的芯片。在redhat kernel 2.4.20-8 下编译。我把购板附带的程序中的kernel都解压缩在kernel文件夹下了。 下面是我编译的错误信息的一部分:[root@yk...
我要做的是把驱动程序编译后下载到arm开发板上。我用的是三星的s3c2410x的芯片。在redhat kernel 2.4.20-8 下编译。我把购板附带的程序中的kernel都解压缩在kernel文件夹下了。
下面是我编译的错误信息的一部分:[root@ykh glj]# armv4l-unknown-linux-gcc -I/home/glj/kernel/include -o s3c2410-ts s3c2410-ts.c
In file included from /home/glj/kernel/include/linux/sched.h:14,
from /home/glj/kernel/include/linux/mm.h:4,
from /home/glj/kernel/include/linux/locks.h:5,
from /home/glj/kernel/include/linux/devfs_fs_kernel.h:6,
from /home/glj/kernel/include/linux/miscdevice.h:4,
from s3c2410-ts.c:30:
/home/glj/kernel/include/linux/timex.h:173: field `time' has incomplete type
In file included from /home/glj/kernel/include/linux/sched.h:18,
from /home/glj/kernel/include/linux/mm.h:4,
from /home/glj/kernel/include/linux/locks.h:5,
from /home/glj/kernel/include/linux/devfs_fs_kernel.h:6,
from /home/glj/kernel/include/linux/miscdevice.h:4,
from s3c2410-ts.c:30:
/home/glj/kernel/include/asm/semaphore.h:18: parse error before `wait_queue_head_t'
/home/glj/kernel/include/asm/semaphore.h:18: warning: no semicolon at end of struct or union
/home/glj/kernel/include/asm/semaphore.h: In function `sema_init':
/home/glj/kernel/include/asm/semaphore.h:47: dereferencing pointer to incomplete type
/home/glj/kernel/include/asm/semaphore.h:48: dereferencing pointer to incomplete type
/home/glj/kernel/include/asm/semaphore.h:49: dereferencing pointer to incomplete type
帮我看看出现这些错误的原因,是不是我编译的方法问题,还是在编译的时候还要加什么条件的?
谢谢!
下面是我编译的错误信息的一部分:[root@ykh glj]# armv4l-unknown-linux-gcc -I/home/glj/kernel/include -o s3c2410-ts s3c2410-ts.c
In file included from /home/glj/kernel/include/linux/sched.h:14,
from /home/glj/kernel/include/linux/mm.h:4,
from /home/glj/kernel/include/linux/locks.h:5,
from /home/glj/kernel/include/linux/devfs_fs_kernel.h:6,
from /home/glj/kernel/include/linux/miscdevice.h:4,
from s3c2410-ts.c:30:
/home/glj/kernel/include/linux/timex.h:173: field `time' has incomplete type
In file included from /home/glj/kernel/include/linux/sched.h:18,
from /home/glj/kernel/include/linux/mm.h:4,
from /home/glj/kernel/include/linux/locks.h:5,
from /home/glj/kernel/include/linux/devfs_fs_kernel.h:6,
from /home/glj/kernel/include/linux/miscdevice.h:4,
from s3c2410-ts.c:30:
/home/glj/kernel/include/asm/semaphore.h:18: parse error before `wait_queue_head_t'
/home/glj/kernel/include/asm/semaphore.h:18: warning: no semicolon at end of struct or union
/home/glj/kernel/include/asm/semaphore.h: In function `sema_init':
/home/glj/kernel/include/asm/semaphore.h:47: dereferencing pointer to incomplete type
/home/glj/kernel/include/asm/semaphore.h:48: dereferencing pointer to incomplete type
/home/glj/kernel/include/asm/semaphore.h:49: dereferencing pointer to incomplete type
帮我看看出现这些错误的原因,是不是我编译的方法问题,还是在编译的时候还要加什么条件的?
谢谢!
|
引用的头文件版本问题