Linux / videodev.h: no such file or directory - OpenCV on ubuntu 11.04

I tried installing OpenCV2.2 on Ubuntu 11.04. But compiling OpenCV does not allow you to specify the error associated with the linux / videodev.h file. The file available in / user / includes / linux is called videodev2.h.

/home/user/OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp:217:28: fatal error: linux/videodev.h: No such file or directory compilation terminated. make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_v4l.o] Error 1 make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: *** [all] Error 2 

Is there a solution for this?

thank.

+55
c ++ opencv
Apr 30 2018-11-11T00:
source share
5 answers
 sudo apt-get install libv4l-dev 

Editing systems based on RH :

On Fedora 16 to install pygame 1.9.1 (in virtualenv):

 sudo yum install libv4l-devel sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h 
+62
May 05 '11 at 13:49
source share

The current answer is incomplete. Installing libv4l-dev creates /usr/include/linux/videodev2.h but does not solve the stated problem of being unable to find linux/videodev.h . The library stores header files for compatibility, but you cannot place them where applications will look for them.

 sudo apt-get install libv4l-dev cd /usr/include/linux sudo ln -s ../libv4l1-videodev.h videodev.h 

This provides linux/videodev.h and the correct version (1).

+78
Dec 25
source share

The patch is here: https://code.ros.org/trac/opencv/attachment/ticket/862/OpenCV-2.2-nov4l1.patch

By adding #ifdef HAVE_CAMV4L around

 #include <linux/videodev.h> 

in OpenCV-2.2.0/modules/highgui/src/cap_v4l.cpp and removing || defined (HAVE_CAMV4L2) || defined (HAVE_CAMV4L2) from line 174 allowed me to compile.

+3
May 12 '11 at
source share

V4l support has been removed in recent kernel versions (including Ubuntu 11.04).

EDIT . Your question is related to the message that was sent to the OpenCV user group, which has instructions for compiling OpenCV 2.2 in Ubuntu 11.04. Your approach is not perfect.

+2
Apr 30 '11 at 19:52
source share

for CMake remove / disable variables with_libv4l with_v4l if you do not need this library.

0
Nov 01 '16 at 19:51
source share



All Articles