请各位高手帮忙看一下这是什么问题?
这是程序:
#include<stdio.h>
#include<linux/kdev_t.h>
#include<linux/types.h>
#include<linux/fs.h>
void main()
{
int a,b,c,d;
int scull_major,scull_minor;
dev_t s;
//ss=MKDEV(scull_major,scull_minor);
//a=register_chrdev_region(ss,1,"www");
//printf("a=%d\n",a);
}
这是显示的错误:
register.c: In function ‘main’:
register.c:9: error: ‘dev_t’ undeclared (first use in this function)
register.c:9: error: (Each undeclared identifier is reported only once
register.c:9: error: for each function it appears in.)
register.c:9: error: expected ‘;’ before ‘s’
这是头文件#include<linux/types.h>中关于dev_t的定义:
typedef __u32 __kernel_dev_t;
typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t; |