欢迎来到天天文库
浏览记录
ID:1771307
大小:29.50 KB
页数:3页
时间:2017-11-13
《makefile make 错误》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Makefilemake错误1、make-C/lib/modules/2.6.31.5-127.fc12.i686.PAE/buildM=/home/ximo/kernel/practise/exammodulesmake:***/lib/modules/2.6.31.5-127.fc12.i686.PAE/build:Nosuchfileordirectory.Stop.make:***[default]Error2(版本错误)修改:vim/boot/grub/grub.conf将default改为02、obj-m“-m”与“o
2、bj”之间没有空格。3、#include#includestatic__initinthello_init(void){printk("helloworld”);return0;}static__exitvoidhello_exit(void){printk("Goodbye,kernel!/n");}module_init(hello_init);module_exit(hello_exit);该程序make出错,错误信息为make-C/lib/modules/2.
3、6.32.26-175.fc12.i686/buildM=/home/ximo/kernel/practise/exammodulesmake[1]:Enteringdirectory`/usr/src/kernels/2.6.32.26-175.fc12.i686'CC[M]/home/ximo/kernel/practise/exam/exam.o/home/ximo/kernel/practise/exam/exam.c:4:error:expected‘=’,‘,’,‘;’,‘asm’or‘__attribute__’be
4、fore‘int’/home/ximo/kernel/practise/exam/exam.c:9:error:expected‘=’,‘,’,‘;’,‘asm’or‘__attribute__’before‘void’/home/ximo/kernel/practise/exam/exam.c:Infunction‘__inittest’:/home/ximo/kernel/practise/exam/exam.c:13:error:‘hello_init’undeclared(firstuseinthisfunction)/h
5、ome/ximo/kernel/practise/exam/exam.c:13:error:(Eachundeclaredidentifierisreportedonlyonce/home/ximo/kernel/practise/exam/exam.c:13:error:foreachfunctionitappearsin.)/home/ximo/kernel/practise/exam/exam.c:Infunction‘__exittest’:/home/ximo/kernel/practise/exam/exam.c:14
6、:error:‘hello_exit’undeclared(firstuseinthisfunction)make[2]:***[/home/ximo/kernel/practise/exam/exam.o]Error1make[1]:***[_module_/home/ximo/kernel/practise/exam]Error2make[1]:Leavingdirectory`/usr/src/kernels/2.6.32.26-175.fc12.i686'make:***[default]Error2修改:将__exit和
7、__init去掉即可。Make成功后,insmod.ko,dmesg查看打印信息。
此文档下载收益归作者所有