LDD编译错误

1,

错误:

make -C /lib/modules/2.6.32-21-generic/build M=/home/qwq/first/LDD/block/sbull modules
make[1]: 正在进入目录 `/usr/src/linux-headers-2.6.32-21-generic'
scripts/Makefile.build:49: *** CFLAGS was changed in "/home/qwq/first/LDD/block/sbull/Makefile". Fix it to use EXTRA_CFLAGS。 停止。
make[1]: *** [_module_/home/qwq/first/LDD/block/sbull] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-2.6.32-21-generic'
make: *** [default] 错误 2

解决:

CFLAGS was changed Fix it to use EXTRA_CFLAGS

这个标志已经变了,把makefile中的 CFLAGS 替换威EXTRA_CFLAGS

2,

错误:

make[1]: 正在进入目录 `/usr/src/linux-headers-2.6.32-21-generic'
  CC [M]  /home/qwq/first/LDD/block/sbull/sbull.o
/home/qwq/first/LDD/block/sbull/sbull.c:8:26: error: linux/config.h: 没有那个文件或目录
/home/qwq/first/LDD/block/sbull/sbull.c:109: error: expected ‘)’ before ‘*’ token
/home/qwq/first/LDD/block/sbull/sbull.c: In function ‘sbull_xfer_bio’:
/home/qwq/first/LDD/block/sbull/sbull.c:150: error: implicit declaration of function ‘bio_cur_sectors’
/home/qwq/first/LDD/block/sbull/sbull.c: In function ‘sbull_xfer_request’:


解决:

The file include/linux/config.h has been removed from 2.6.18 kernel. So remember this if you build your favorite module against the new 2.6.19 kernel and you get an error。 Thats because there is no more include/linux/config.h file in 2.6.19.

Put linux/config.h out of its misery. 把这个头文件注释掉即可



错误:

make -C /lib/modules/2.6.32-21-generic/build M=/home/qwq/first/LDD/block/sbull modules
make[1]: 正在进入目录 `/usr/src/linux-headers-2.6.32-21-generic'
  CC [M]  /home/qwq/first/LDD/block/sbull/sbull.o
/home/qwq/first/LDD/block/sbull/sbull.c:109: error: expected ‘)’ before ‘*’ token
/home/qwq/first/LDD/block/sbull/sbull.c: In function ‘sbull_xfer_bio’:
/home/qwq/first/LDD/block/sbull/sbull.c:150: error: implicit declaration of function ‘bio_cur_sectors’
/home/qwq/first/LDD/block/sbull/sbull.c: In function ‘sbull_xfer_request’:
/home/qwq/first/LDD/block/sbull/sbull.c:166: error: implicit declaration of function ‘rq_for_each_bio’
/home/qwq/first/LDD/block/sbull/sbull.c:166: error: expected ‘;’ before ‘{’ token
/home/qwq/first/LDD/block/sbull/sbull.c:164: warning: unused variable ‘nsect’
/home/qwq/first/LDD/block/sbull/sbull.c:171: warning: no return statement in function returning non-void
/home/qwq/first/LDD/block/sbull/sbull.c: At top level:
/home/qwq/first/LDD/block/sbull/sbull.c:178: error: expected ‘)’ before ‘*’ token
/home/qwq/first/LDD/block/sbull/sbull.c:203: error: expected ‘)’ before ‘*’ token
/home/qwq/first/LDD/block/sbull/sbull.c:328: warning: initialization from incompatible pointer type
/home/qwq/first/LDD/block/sbull/sbull.c:329: warning: initialization from incompatible pointer type
/home/qwq/first/LDD/block/sbull/sbull.c:333: warning: initialization from incompatible pointer type
/home/qwq/first/LDD/block/sbull/sbull.c: In function ‘setup_device’:
/home/qwq/first/LDD/block/sbull/sbull.c:371: error: ‘sbull_make_request’ undeclared (first use in this function)
/home/qwq/first/LDD/block/sbull/sbull.c:371: error: (Each undeclared identifier is reported only once
/home/qwq/first/LDD/block/sbull/sbull.c:371: error: for each function it appears in.)
/home/qwq/first/LDD/block/sbull/sbull.c:375: error: ‘sbull_full_request’ undeclared (first use in this function)
/home/qwq/first/LDD/block/sbull/sbull.c:385: error: ‘sbull_request’ undeclared (first use in this function)
/home/qwq/first/LDD/block/sbull/sbull.c:392: error: implicit declaration of function ‘blk_queue_hardsect_size’
make[2]: *** [/home/qwq/first/LDD/block/sbull/sbull.o] 错误 1
make[1]: *** [_module_/home/qwq/first/LDD/block/sbull] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-2.6.32-21-generic'
make: *** [default] 错误 2





参考http://hi.baidu.com/zr1988/blog/item/c98e833d551397ca9e3d6215.html/cmtid/93ea1ffbc0b295186d22eb84


你可能感兴趣的:(function,Module,each,makefile,initialization,returning)