uvc_v4l2_ioctl.h 提示出错 too few arguments to function ‘v4l_printk_ioctl’

今天编译了UVC的摄像头的驱动,突然不给力了老是提示以下错误:

/home/king/work/Maxim/64380-3.2.4/host/Linux/uvcdriver/src/uvcvideo-next/uvc_v4l2.c: In function ‘uvc_v4l2_ioctl’:

/home/king/work/Maxim/64380-3.2.4/host/Linux/uvcdriver/src/uvcvideo-next/uvc_v4l2.c:1092:3: warning: passing argument 1 of ‘v4l_printk_ioctl’ makes pointer from integer without a cast [enabled by default]
include/media/v4l2-ioctl.h:301:13: note: expected ‘const char *’ but argument is of type ‘unsigned int’
/home/king/work/Maxim/64380-3.2.4/host/Linux/uvcdriver/src/uvcvideo-next/uvc_v4l2.c:1092:3: error: too few arguments to function ‘v4l_printk_ioctl’
include/media/v4l2-ioctl.h:301:13: note: declared here
make[2]: *** [/home/king/work/Maxim/64380-3.2.4/host/Linux/uvcdriver/src/uvcvideo-next/uvc_v4l2.o] Error 1
make[1]: *** [_module_/home/king/work/Maxim/64380-3.2.4/host/Linux/uvcdriver/src/uvcvideo-next] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-29-generic'
make: *** [all] Error 2
以前编译都正常,今天就是换了个系统,3.8.0-30-generic不应该呀,于是找了以前版本的 uvc_v4l2_ioctl.h

和系统中的uvc_v4l2_ioctl.h 对比果然改了好多东东,这也需就是为什么我编译过去的原因。于是乎直接:

将 /lib/modules/(uname -a)/build/include/media/v4l2-ioctl.h的给做了个备份
#mv ./v4l2-ioctl.h ./v4l2-ioctl.h_bak

将能够用的(老的)v4l2-ioctl.h拷贝到该文件夹下
#mv ~/v4l2-ioctl.h ./

OK,编译通过。

退出来进入到uvcideo里面编译驱动,顺利通过,而后对比了两个文件发现不宜样的地方有十几处,晕死了,那个家伙修改了文件也不在系统里面提示一下。

对比了两个头文件:

新的:void v4l_printk_ioctl(const char *prefix, unsigned int cmd)

原来的:void v4l_printk_ioctl(unsigned int cmd)

因此如果不更改原头文件可以将调用函数写成 v4l_printk_ioctl(“A”,cmd); 也可以实现编译通过。


你可能感兴趣的:(ubuntu,linux)