While building OpenCV I accidentally linked the wrong header file.
Instead of linking videodeh.h
like this :
$ sudo apt-get install libdc1394-22 libdc1394-22-dev libxine2-dev libv4l-dev v4l-utils
$ cd /usr/include/linux
$ sudo ln -s -f ../libv4l1-videodev.h videodev.h
I did accidentally linked videodev2.h
, like this:
$ sudo apt-get install libdc1394-22 libdc1394-22-dev libxine2-dev libv4l-dev v4l-utils
$ cd /usr/include/linux
$ sudo ln -s -f ../libv4l1-videodev.h videodev2.h
Now when I unlinked videodev2.h
(sudo unlink videodev2.h
) it removed the hearder file from /usr/include/linux
.
I tried reinstating videodev2.h
by installing libv4l-dev
and v4l-utils
(sudo apt-get install libv4l-dev v4l-utils
) but to no avail. I also just straight up copied videodev2.h
from here, but that gives me this error while building opencv:
In file included from /home/rafay/opencv/modules/videoio/src/cap_v4l.cpp:235:
/usr/include/linux/videodev2.h:63:10: fatal error: linux/compiler.h: No such file or directory
#include <linux/compiler.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
Any help that can reinstate videodev2.h
without reinstalling Ubuntu will be appreciated.