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

前端 未结 5 2117
小鲜肉
小鲜肉 2020-12-23 11:26

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 name

相关标签:
5条回答
  • 2020-12-23 11:36

    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).

    0 讨论(0)
  • 2020-12-23 11:46

    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) from line 174 allowed me to compile.

    0 讨论(0)
  • 2020-12-23 11:47

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

    0 讨论(0)
  • 2020-12-23 11:48
    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 
    
    0 讨论(0)
  • 2020-12-23 11:52

    v4l support has been dropped in recent kernel versions (including the one shipped with Ubuntu 11.04).

    EDIT: Your question is connected to a recent message that was sent to the OpenCV users group, which has instructions to compile OpenCV 2.2 in Ubuntu 11.04. Your approach is not ideal.

    0 讨论(0)
提交回复
热议问题