fatal error: sys/videoio.h: No such file or directory
Determining if the include file sys/videoio.h exists failed with the following output:
Change Dir: /home/program/opencv-3.2.0/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_3c438/fast"
/usr/bin/make -f CMakeFiles/cmTC_3c438.dir/build.make CMakeFiles/cmTC_3c438.dir/build
make[1]: Entering directory '/home/program/opencv-3.2.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3c438.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 -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -o CMakeFiles/cmTC_3c438.dir/CheckIncludeFile.c.o -c /home/program/opencv-3.2.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/program/opencv-3.2.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:25: fatal error: sys/videoio.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_3c438.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_3c438.dir/CheckIncludeFile.c.o' failed
make[1]: *** [CMakeFiles/cmTC_3c438.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/program/opencv-3.2.0/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_3c438/fast' failed
make: *** [cmTC_3c438/fast] Error 2
解决方案:
百度后的方法,千篇一律,都是禁用ippicv即可。
但是这个错误可以忽略,关注其他不可用项就可以。
最后使用如下命令:
sudo cmake .. -DCMAKE_BUILD_TYPE=Release -DCUDA_nppi_LIBRARY=true -DWITH_CUDA=OFF -DBUILD_TIFF=ON
编译通过