scull 编译错误
问题1:
make -C /lib/modules/2.6.26-2-686/build M=/usr/local/workspace/ldd3_examples/scull LDDINC=/usr/local/workspace/ldd3_examples/scull/../include modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-2-686'
scripts/Makefile.build:46: *** CFLAGS was changed in "/usr/local/workspace/ldd3_examples/scull/Makefile". Fix it to use EXTRA_CFLAGS。 停止。
make[1]: *** [_module_/usr/local/workspace/ldd3_examples/scull] 错误 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-686'
make: *** [modules] 错误 2
解决办法:在新版本的内核中,CFLAGS已经改成EXTRA_CFLAGS了
问题2:
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-2-686'
CC [M] /usr/local/workspace/ldd3_examples/scull/main.o
/usr/local/workspace/ldd3_examples/scull/main.c:15:26: error: linux/config.h: 没有那个文件或目录
make[2]: *** [/usr/local/workspace/ldd3_examples/scull/main.o] 错误 1
make[1]: *** [_module_/usr/local/workspace/ldd3_examples/scull] 错误 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-2-686'
make: *** [modules] 错误 2
1) 在access.c中添加#include
2) 把main.c 中的//#include 注释掉
阅读(673) | 评论(0) | 转发(0) |