构建 opencv 时 CMake 返回 linux/videodev.h 不存在

构建 opencv 时 CMake 返回 linux/videodev.h 不存在

opencv根据构建时遇到问题关联

Determining if the include file linux/videodev.h exists failed with the following output:
Change Dir: /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_affcb/fast"
/usr/bin/make -f CMakeFiles/cmTC_affcb.dir/build.make CMakeFiles/cmTC_affcb.dir/build
make[1]: Entering directory '/home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_affcb.dir/CheckIncludeFile.c.o
/usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_affcb.dir/CheckIncludeFile.c.o   -c /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:28: fatal error: linux/videodev.h: No such file or directory
 #include <linux/videodev.h>
                            ^
compilation terminated.

…………

我只是做了 cd linux 来查看文件 videodev.h 是否在那里,但系统找不到这样的目录。文件/usr/include/linux/videodev.h存在于我的系统上。我想编译器无法找到它。如何解决这样的问题呢?

答案1

这会做:

sudo apt-get install libv4l-dev
sudo ln -s ../libv4l1-videodev.h videodev.h

相关内容