我想追踪这篇文章 有关 v4l2 s 驱动程序写入的内容。
但当我把媒体/V4l2-dev.h(因为我想访问VFL_TYPE_GRABER等宏)包括在内时,我的第一个基本尝试失败了。
h 包括 linux/iopport.h 用此输出碰撞的 :
In file included from /usr/src/linux/include/linux/device.h:16,
from /usr/src/linux/include/media/v4l2-dev.h:14,
from driv.c:11:
/usr/src/linux/include/linux/ioport.h:19: error: expected specifier-qualifier-list before ‘resource_size_t’
/usr/src/linux/include/linux/ioport.h:116: error: expected declaration specifiers or ‘...’ before ‘resource_size_t’
/usr/src/linux/include/linux/ioport.h:116: error: expected declaration specifiers or ‘...’ before ‘resource_size_t’
/usr/src/linux/include/linux/ioport.h:121: error: expected declaration specifiers or ‘...’ before ‘resource_size_t’
[.]
来源:
#include <asm/types.h>
#include <linux/videodev2.h>
#include <media/v4l2-dev.h>
int main(int argc, char **argv) {
return 0;
}
我编译了:
gcc -I/usr/src/linux/arch/x86/include -I/usr/src/linux/include -o prog prog.c
It occurs on 2.6.32-37-generic-pae with gcc 4.4.3 glibc 2.10 I tried the same on a gentoo with approximative equivalent version of kernel-headers and gcc.
我做错什么了?
编辑: 指定准确包含路径 。