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.
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).
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With