问题:
编译时发现这种莫名其妙的错误。
/home/user/driver/first_drv/first_drv.c:1: error: stray '\357' in program
/home/user/driver/first_drv/first_drv.c:1: error: stray '\273' in program
/home/user/driver/first_drv/first_drv.c:1: error: stray '\277' in program
/home/user/driver/first_drv/first_drv.c:1: error: stray '#' in program
/home/user/driver/first_drv/first_drv.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
In file included from include/linux/sysinfo.h:4,
from include/linux/kernel.h:4,
原因:
我的文件是UTF-8格式,可能是我的Ubuntu不支持。
解决方法:
将格式改为ANSI即可。