Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I tried to install OpenCV2.2 on Ubuntu 11.04. But OpenCV compilation fails stating an error related to linux/videodev.h file. File available in /user/includes/linux is named 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 you.

like image 233
Niroshan Avatar asked Apr 30 '11 14:04

Niroshan


2 Answers

The current answer is incomplete. Installing libv4l-dev creates a /usr/include/linux/videodev2.h but doesn't solve the stated problem of not being able to find linux/videodev.h. The library does ship header files for compatibility, but fails to put 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 a linux/videodev.h, and of the right version (1).

like image 91
bukzor Avatar answered Sep 19 '22 21:09

bukzor


sudo apt-get install libv4l-dev 

Editing for RH based systems :

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

sudo yum install libv4l-devel sudo ln -s /usr/include/libv4l1-videodev.h   /usr/include/linux/videodev.h  
like image 43
Alberto Avatar answered Sep 21 '22 21:09

Alberto