最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

some silly mistakes: error: ‘param_get_1’ undeclared here (not in a function)

工作和技术 crifan 1660浏览 0评论

after write done the source code and Makefile, then do following:
————————————————————————————————————————————
crifan@ubuntu810:/usr/crifan/develop/driver/char_dev$ make
make -C /lib/modules/2.6.27-7-generic/build M=/usr/crifan/develop/driver/char_dev modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-generic’
CC [M] /usr/crifan/develop/driver/char_dev/char_dev.o
/usr/crifan/develop/driver/char_dev/char_dev.c:18: error: expected ‘)’ before ‘&’ token
/usr/crifan/develop/driver/char_dev/char_dev.c:18: error: ‘param_set_1’ undeclared here (not in a function)
/usr/crifan/develop/driver/char_dev/char_dev.c:18: error: ‘param_get_1’ undeclared here (not in a function)
/usr/crifan/develop/driver/char_dev/char_dev.c:19: error: ‘S_IRGUO’ undeclared here (not in a function)
make[2]: *** [/usr/crifan/develop/driver/char_dev/char_dev.o] Error 1
make[1]: *** [_module_/usr/crifan/develop/driver/char_dev] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-generic’
make: *** [default] Error 2

————————————————————————————————————————————

so, don’t know the error "error: ‘param_get_1’ undeclared here (not in a function)"
go to google & baidu, but find no discuss about this, after so long time to find the reason about this, in the end , I find the reason for this error is in this line:
module_param(howmany, 1, S_IRUGO);
I silly type the "int" to "1"
so that line should be:
module_param(howmany, int, S_IRUGO);
!!!

转载请注明:在路上 » some silly mistakes: error: ‘param_get_1’ undeclared here (not in a function)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
79 queries in 0.162 seconds, using 22.10MB memory