Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compiler errors 处理用户时编译内核驱动程序失败_Compiler Errors_Linux Kernel_Driver - Fatal编程技术网

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内核编译?我需要进一步研究!