新手入门
- 积分
- 10
- 金钱
- 10
- 注册时间
- 2023-12-19
- 在线时间
- 2 小时
|
楼主 |
发表于 2024-4-17 16:52:25
|
显示全部楼层
问题未解决前的报错信息:
make -C /home/lingling/linux/imx6ull/linux-imx-rel_imx_4.1.15_2.1.0_ga M=/home/lingling/linux/Linux_Drivers/1_chrdevbase modules
make[1]: Entering directory '/home/lingling/linux/imx6ull/linux-imx-rel_imx_4.1.15_2.1.0_ga'
CC [M] /home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.o
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:4:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chrdevbase_int’
static int _init chrdevbase_int(void)
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:9:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘chrdevbase_exit’
static void _exit chrdevbase_exit(void)
^
In file included from include/linux/printk.h:5:0,
from include/linux/kernel.h:13,
from include/linux/list.h:8,
from include/linux/module.h:9,
from /home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:1:
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c: In function ‘__inittest’:
include/linux/init.h:349:4: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
{ return initfn; } \
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:21:1: note: in expansion of macro ‘module_init’
module_init(); /*入口*/
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c: In function ‘__exittest’:
include/linux/init.h:355:4: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
{ return exitfn; } \
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:22:1: note: in expansion of macro ‘module_exit’
module_exit(); /*出口*/
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c: At top level:
include/linux/init.h:350:6: error: ‘init_module’ aliased to undefined symbol ‘’
int init_module(void) __attribute__((alias(#initfn)));
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:21:1: note: in expansion of macro ‘module_init’
module_init(); /*入口*/
^
include/linux/init.h:356:7: error: ‘cleanup_module’ aliased to undefined symbol ‘’
void cleanup_module(void) __attribute__((alias(#exitfn)));
^
/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.c:22:1: note: in expansion of macro ‘module_exit’
module_exit(); /*出口*/
^
scripts/Makefile.build:264: recipe for target '/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.o' failed
make[2]: *** [/home/lingling/linux/Linux_Drivers/1_chrdevbase/chrdevbase.o] Error 1
Makefile:1384: recipe for target '_module_/home/lingling/linux/Linux_Drivers/1_chrdevbase' failed
make[1]: *** [_module_/home/lingling/linux/Linux_Drivers/1_chrdevbase] Error 2
make[1]: Leaving directory '/home/lingling/linux/imx6ull/linux-imx-rel_imx_4.1.15_2.1.0_ga'
Makefile:11: recipe for target 'kernel_modules' failed
make: *** [kernel_modules] Error 2 |
|