opencv: ubuntu trusty 14.04 --> cannot compile opencv 3.1.0 >> cmake videoio.h not found (but all libv4l packages are installed and updated)
alfonso@alfonso:~/Documents/opencv/opencv-3.1.0/release$ sudo cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DWITH_OPENGL=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DWITH_IPP=ON -DINSTALL_CREATE_DISTRIB=ON -D OPENCV_EXTRA_MODULES_PATH=/home/alfonso/Documents/opencv/opencv_contrib/modules -DBUILD_opencv_ts=0 …
-- Detected version of GNU GCC: 48 (408)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so
-- checking for module 'gstreamer-base-1.0'
-- package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
-- package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
-- package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
-- package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
-- package 'gstreamer-pbutils-1.0' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavresample'
-- package 'libavresample' not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - found
-- checking for module 'libgphoto2'
-- package 'libgphoto2' not found
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/alfonso/Documents/opencv/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
-- CUDA detected: 7.5
-- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30
-- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4")
-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found suitable exact version "3.4.3")
-- Found apache ant 1.9.3: /usr/bin/ant
-- Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
-- Found VTK ver. 6.0.0 (usefile: /usr/lib/cmake/vtk-6.0/UseVTK.cmake)
-- Caffe: NO
-- Protobuf: YES
-- Glog: NO
-- HDF5: YES
-- Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
-- Tesseract: NO
-- Processing WORLD modules...
-- module opencv_cudev...
CMake Error at modules/cudev/CMakeLists.txt:21 (add_subdirectory):
add_subdirectory given source "test" which is not an existing directory.
Call Stack (most recent call first):
modules/world/CMakeLists.txt:13 (include)
modules/world/CMakeLists.txt:25 (include_one_module)
-- module opencv_core...
-- module opencv_cudaarithm...
-- module opencv_flann...
-- module opencv_imgproc...
-- module opencv_ml...
-- module opencv_video...
-- module opencv_viz...
-- module opencv_cudabgsegm...
-- module opencv_cudafilters...
-- module opencv_cudaimgproc...
-- module opencv_cudawarping...
-- module opencv_imgcodecs...
-- module opencv_photo...
-- module opencv_shape...
-- module opencv_videoio...
-- module opencv_cudacodec...
-- module opencv_highgui...
-- module opencv_objdetect...
-- module opencv_features2d...
-- module opencv_calib3d...
-- module opencv_cudafeatures2d...
-- module opencv_cudalegacy...
-- module opencv_cudaobjdetect...
-- module opencv_cudaoptflow...
-- module opencv_cudastereo...
-- module opencv_stitching...
-- module opencv_superres...
-- module opencv_videostab...
-- Processing WORLD modules... DONE
-- Processing module opencv_xfeatures2d...
-- Processing module opencv_ximgproc...
-- Processing module opencv_xobjdetect...
-- Processing module opencv_xphoto...
-- Processing module opencv_aruco...
-- Processing module opencv_bgsegm...
-- Processing module opencv_bioinspired...
-- Processing module opencv_ccalib...
-- Processing module opencv_cvv...
-- Processing module opencv_dnn...
-- Build libprotobuf from sources:
-- The protocol buffer compiler not found
-- Processing module opencv_dpm...
-- Processing module opencv_face...
-- Processing module opencv_fuzzy...
-- Processing module opencv_hdf...
-- HDF5: YES
CMake Warning (dev) at /home/alfonso/Documents/opencv/opencv_contrib/modules/hdf/CMakeLists.txt:20 (target_link_libraries):
Policy CMP0023 is not set: Plain and keyword target_link_libraries
signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
The keyword signature for target_link_libraries has already been used with
the target "opencv_hdf". All uses of target_link_libraries with a target
should be either all-keyword or all-plain.
The uses of the keyword signature are here:
* /home/alfonso/Documents/opencv/opencv-3.1.0/cmake/OpenCVUtils.cmake:731 (target_link_libraries)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Processing module opencv_line_descriptor...
-- Processing module opencv_optflow...
-- Processing module opencv_plot...
-- Processing module opencv_reg...
-- Processing module opencv_rgbd...
-- Processing module opencv_saliency...
-- Processing module opencv_stereo...
-- Processing module opencv_structured_light...
-- Processing module opencv_surface_matching...
-- Processing module opencv_text...
-- Tesseract: NO
-- Processing module opencv_datasets...
-- Processing module opencv_tracking...
--
-- General configuration for OpenCV 3.1.0 =====================================
-- Version control: unknown
--
-- Platform:
-- Host: Linux 3.19.0-51-generic x86_64
-- CMake: 2.8.12.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.8.4)
-- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -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 -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -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 -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: YES
-- Extra dependencies: /usr/lib/x86_64-linux-gnu/libhdf5.so /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so dl m pthread rt /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so tbb cudart nppc nppi npps cublas cufft -L/usr/local/cuda/lib64
-- 3rdparty dependencies:
--
-- OpenCV modules:
-- To be built: cudev core cudaarithm flann imgproc ml video viz cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui objdetect features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab world xfeatures2d ximgproc xobjdetect xphoto aruco bgsegm bioinspired ccalib cvv dnn dpm face fuzzy hdf line_descriptor optflow plot reg rgbd saliency stereo structured_light surface_matching text datasets tracking
-- Disabled: ts contrib_world
-- Disabled by dependency: -
-- Unavailable: java python2 matlab sfm
--
-- GUI:
-- QT 5.x: YES (ver 5.2.1)
-- QT OpenGL support: YES (Qt5::OpenGL 5.2.1)
-- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so)
-- VTK support: YES (ver 6.0.0)
--
-- Media I/O:
-- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
-- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
-- WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0202)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.50)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.3)
-- JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
-- OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 1.6.1)
-- GDAL: /usr/lib/libgdal.so
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.2.1)
-- FFMPEG: YES
-- codec: YES (ver 57.28.103)
-- format: YES (ver 57.28.101)
-- util: YES (ver 55.19.100)
-- swscale: YES (ver 4.0.100)
-- resample: NO
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.36)
-- video: YES (ver 0.10.36)
-- app: YES (ver 0.10.36)
-- riff: YES (ver 0.10.36)
-- pbutils: YES (ver 0.10.36)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- OpenNI2: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l1 (ver 0.8.8) / libv4l2 (ver 0.8.8)
-- XIMEA: NO
-- Xine: YES (ver 1.1.21)
-- gPhoto2: NO
--
-- Parallel framework: TBB (ver 4.2 interface 7000)
--
-- Other third-party libraries:
-- Use IPP: 9.0.1 [9.0.1]
-- at: /home/alfonso/Documents/opencv/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
-- Use IPP Async: NO
-- Use VA: NO
-- Use Intel VA-API/OpenCL: NO
-- Use Eigen: YES (ver 3.2.0)
-- Use Cuda: YES (ver 7.5)
-- Use OpenCL: YES
-- Use custom HAL: NO
--
-- NVIDIA CUDA
-- Use CUFFT: YES
-- Use CUBLAS: YES
-- USE NVCUVID: NO
-- NVIDIA GPU arch: 20 21 30 35
-- NVIDIA PTX archs: 30
-- Use fast math: YES
--
-- OpenCL:
-- Version: dynamic
-- Include path: /home/alfonso/Documents/opencv/opencv-3.1.0/3rdparty/include/opencl/1.2
-- Use AMDFFT: NO
-- Use AMDBLAS: NO
--
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.6)
--
-- Python 3:
-- Interpreter: /usr/bin/python3.4 (ver 3.4.3)
--
-- Python (for build): /usr/bin/python2.7
--
-- Java:
-- ant: /usr/bin/ant (ver 1.9.3)
-- JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include
-- Java wrappers: NO
-- Java tests: NO
--
-- Matlab: Matlab not found or implicitly disabled
--
-- Documentation:
-- Doxygen: /usr/bin/doxygen (ver 1.8.6)
-- PlantUML: NO
--
-- Tests and samples:
-- Tests: NO
-- Performance tests: NO
-- C/C++ Examples: YES
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /home/alfonso/Documents/opencv/opencv-3.1.0/release
-- -----------------------------------------------------------------
--
-- Configuring incomplete, errors occurred!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 32 (9 by maintainers)
Again, “sys/videoio.h not found” is not an error - it is just a check result. So this it is not a problem at all.
FIXED: Now it compiles flawlessy
Tried this tutorial:
https://medium.com/@debugvn/installing-opencv-3-3-0-on-ubuntu-16-04-lts-7db376f93961
It was just an error in my CMake command line:
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules
instead of:
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules
ORIGINAL MESSAGE:
Trying to install OpenCV 3.3.0 with Python 3.4 bindings from source on Linux Mint 17.1 following this tutorial:
http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/
Same CMake problem as everybody else here:
fatal error: sys/videoio.h: File o directory non esistente (= file not found)
I also see another (possibly irrelevant) error in CMakeError.log:
#error “C++11 is not supported”
I have latest libv4l-dev and libv4l-0 installed. I installed both gcc and g++ 4.9.4 I tried every suggested CMake switches combination (-D WITH_LIBV4L=ON/OFF, -D WITH_V4L=OFF/ON, -D INSTALL_C_EXAMPLES=OFF/ON).
No way to get a makefile…
Any suggestion?
sudo cmake -D CMAKE_BUILD_TYPE=Release -D INSTALL_C_EXAMPLES=OFF -D INSTALL_CREATE_DISTRIB=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.1.0/modules/ -D CMAKE_INSTALL_PREFIX=/usr/local ..
Above is my cmake command.Over here it still fails on:
and
Those are the only 2 reasons stated in the
CMakeError.log
, and i did disable the examples andWITH_V4L
.GCC and g++ versions are at 4.9.2. It is on a raspberry pi 3, though.
As a workaround, “-D INSTALL_C_EXAMPLES=OFF” works for me on Ubuntu 14.04 LTS on OpenCV3.1.0. Hope this helps.
http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/ Step 3 mentioned this: “Update (3 January 2016): In order to build OpenCV 3.1.0 , you need to set -D INSTALL_C_EXAMPLES=OFF (rather than ON ) in the cmake command. There is a bug in the OpenCV v3.1.0 CMake build script that can cause errors if you leave this switch on. Once you set this switch to off, CMake should run without a problem.”
to get any v4l support, you must compile with
WITH_V4L = ON
. as libv4l is deprecated also setWITH_LIBV4L = OFF
. The check forsys/videoio.h
is just there for BSD and should not fail the cmake configure step. If it fails, you might have a different (related) error.Same problem here (Installing OpenCV 3.1.0-dev under Ubuntu 16.04). After I set WITH_V4L = OFF but still keep WITH_LIBV4L = ON, the configuring skipped the searching of ‘sys/videoio.h’, and the compilation worked.
You can check your gcc and g++ version. It should work for at least 4.9 version.
You can upgrade/install new version of gcc and g++ using this commands
Hope this help you solve the compilation error.
Same problem here. Following the documentation instructions and still got this error.
Update: Reading up the conversation, the
-D WITH_LIBV4L=OFF
worked.