我试图在CentOS 7(PC)上安装OpenCV-2.4.9,但是在运行" make"命令。我保留OpenCV的默认配置。
make
...
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_v4l.cpp.o /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:306:29: error: field ‘capability’ has incomplete type
struct video_capability capability;
^ /opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:307:29: error: field ‘captureWindow’ has incomplete type
struct video_window captureWindow;
....
....
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp: In function ‘void icvCloseCAM_V4L(CvCaptureCAM_V4L*)’:
/opt/opencv-2.4.9/opencv/modules/highgui/src/cap_v4l.cpp:2812:46: error: ‘CvCaptureCAM_V4L’ has no member named ‘memoryBuffer’
答案 0 :(得分:1)
似乎HAVE_CAMV4L的定义值为1,如果你查看文件modules / highgui / src / cap_v4l.cpp,在第306行寻找结构定义。如果编译在那时失败,这意味着video4linux开发配置已损坏。
使用谷歌我发现OpenCV Bug#1357描述如下:
CHECK_INCLUDE_FILE(linux / videodev.h HAVE_CAMV4L)成功,即使系统上不存在linux / videodev.h。 (Bug#1357)
http://code.opencv.org/issues/1357
无论如何,解决方案在“HAVE_CAMV4L设置不正确”的同一URL中描述:“在CMakeLists.txt中将其设置为FALSE可解决问题”。