编译HelloWorld 驱动出错

内核编译和嵌入式产品的设计与开发
回复
davalop
帖子: 7
注册时间: 2009-03-09 9:15
送出感谢: 0
接收感谢: 0

编译HelloWorld 驱动出错

#1

帖子 davalop » 2009-03-09 17:51

sonsun@sonsun-desktop:~$ cd Helloworld/
sonsun@sonsun-desktop:~/Helloworld$ ls
hello.c Makefile Makefile~
sonsun@sonsun-desktop:~/Helloworld$ make
make -C /home/sonsun/linux-2.6.20 M=/home/sonsun/Helloworld modules
make[1]: 正在进入目录 `/home/sonsun/linux-2.6.20'
CC [M] /home/sonsun/Helloworld/hello.o
In file included from include/asm/page.h:179,
from include/asm/user.h:4,
from include/asm/elf.h:9,
from include/linux/elf.h:7,
from include/linux/module.h:15,
from /home/sonsun/Helloworld/hello.c:16:
include/asm/memory.h:27:29: asm/arch/memory.h: 没有该文件或目录
In file included from include/asm/page.h:179,
from include/asm/user.h:4,
from include/asm/elf.h:9,
from include/linux/elf.h:7,
from include/linux/module.h:15,
from /home/sonsun/Helloworld/hello.c:16:
include/asm/memory.h: In function `virt_to_phys':
include/asm/memory.h:170: error: `PHYS_OFFSET' undeclared (first use in this function)
include/asm/memory.h:170: error: (Each undeclared identifier is reported only once
include/asm/memory.h:170: error: for each function it appears in.)
include/asm/memory.h: In function `phys_to_virt':
include/asm/memory.h:175: error: `PHYS_OFFSET' undeclared (first use in this function)
include/asm/memory.h: In function `virt_to_bus':
include/asm/memory.h:193: warning: implicit declaration of function `__virt_to_bus'
include/asm/memory.h: In function `bus_to_virt':
include/asm/memory.h:198: warning: implicit declaration of function `__bus_to_virt'
In file included from include/asm/hardirq.h:6,
from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from include/asm/local.h:1,
from include/linux/module.h:19,
from /home/sonsun/Helloworld/hello.c:16:
include/asm/irq.h:4:27: asm/arch/irqs.h: 没有该文件或目录
/home/sonsun/Helloworld/hello.c:33:25: warning: no newline at end of file
make[2]: *** [/home/sonsun/Helloworld/hello.o] 错误 1
make[1]: *** [_module_/home/sonsun/Helloworld] 错误 2
make[1]:正在离开目录 `/home/sonsun/linux-2.6.20'
make: *** [default] 错误 2
头像
cnkilior
论坛版主
帖子: 4979
注册时间: 2007-08-05 17:40
送出感谢: 0
接收感谢: 5 次

Re: 编译HelloWorld 驱动出错

#2

帖子 cnkilior » 2009-03-09 18:45

kernel-header安装了没有哇?
boluor
帖子: 274
注册时间: 2007-10-14 0:11
送出感谢: 0
接收感谢: 0

Re: 编译HelloWorld 驱动出错

#3

帖子 boluor » 2009-03-11 10:33

少了两个文件:asm/arch/memory.h,asm/arch/irqs.h.你找下这两个文件试试.
回复

回到 “内核及嵌入式开发”