Compiler errors 处理用户时编译内核驱动程序失败
编译内核驱动程序时出现编译错误。错误信息为Compiler errors 处理用户时编译内核驱动程序失败,compiler-errors,linux-kernel,driver,Compiler Errors,Linux Kernel,Driver,编译内核驱动程序时出现编译错误。错误信息为 pxa270_gpio_led_drv.c|27 col 70| error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token || static ssize_t SIMPLE_GPIO_LED_read ( struct file *file, char __user *buf, size_t count, loff_t *offset) 源文件的一部分是: static ssize_t SIMPLE_GPIO
pxa270_gpio_led_drv.c|27 col 70| error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
|| static ssize_t SIMPLE_GPIO_LED_read ( struct file *file, char __user *buf, size_t count, loff_t *offset)
源文件的一部分是:
static ssize_t SIMPLE_GPIO_LED_read ( struct file *file, char __user *buf, size_t count, loff_t *offset)
{
#ifdef OURS_GPIO_LED_DEBUG
printk ("SIMPLE_GPIO_LED_read [ --kernel--]\n");
#endif
return count;
}
compile命令是:
gcc -c -Wall -O -D__KERNEL__ -DMODULE -I/home/test/Desktop/linux-2.4.21/include pxa270_gpio_led_drv.c -o pxa270_gpio_led_drv.o
有人能帮我吗?谢谢。您是否包含定义loff\t的内容
__user宏是gcc的指令,不需要包含标题。看起来您缺少包含。定义uuu user的那个,根据错误消息中的列号。为什么你认为这个驱动程序可以为2.4内核编译?我需要进一步研究!