Hey all, I'm using CentOS 5.9 and trying to build OpenCv 2.4.10 for video processing. This is the log of make command:
[ 7%] Built target IlmImf
[ 7%] Built target opencv_core_pch_dephelp
[ 7%] Built target pch_Generate_opencv_core
[ 10%] Built target opencv_core
[ 10%] Built target opencv_ts_pch_dephelp
[ 10%] Built target pch_Generate_opencv_ts
[ 10%] Built target opencv_flann_pch_dephelp
[ 11%] Built target pch_Generate_opencv_flann
[ 12%] Built target opencv_flann
[ 12%] Built target opencv_imgproc_pch_dephelp
[ 12%] Built target pch_Generate_opencv_imgproc
[ 17%] Built target opencv_imgproc
[ 17%] Built target opencv_highgui_pch_dephelp
[ 17%] Built target pch_Generate_opencv_highgui
[ 19%] Built target opencv_highgui
[ 19%] Built target opencv_features2d_pch_dephelp
[ 19%] Built target pch_Generate_opencv_features2d
[ 21%] Built target opencv_features2d
[ 22%] Built target opencv_video_pch_dephelp
[ 22%] Built target pch_Generate_opencv_video
[ 23%] Built target opencv_video
[ 24%] Built target opencv_ts
[ 24%] Built target opencv_perf_core_pch_dephelp
[ 25%] Built target pch_Generate_opencv_perf_core
Linking CXX executable ../../bin/opencv_perf_core
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `cvCreateCameraCapture_V4L(int)'
collect2: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [all] Error 2
And this is the log of cmake with v4l on option:
-- Detected version of GNU GCC: 44 (404)
-- checking for module 'gstreamer-base-1.0'
-- package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
-- package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
-- package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
-- package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
-- package 'gstreamer-pbutils-1.0' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "2.6.6")
--
-- General configuration for OpenCV 2.4.10 =====================================
-- Version control: unknown
--
-- Platform:
-- Host: Linux 2.6.32-504.8.1.el6.x86_64 x86_64
-- CMake: 2.8.12.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/gmake
-- Configuration: RELEASE
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.4.7)
-- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release):
-- Linker flags (Debug):
-- Precompiled headers: YES
--
-- OpenCV modules:
-- To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib stitching superres ts videostab
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: androidcamera dynamicuda java python viz
--
-- GUI:
-- QT: NO
-- GTK+ 2.x: YES (ver 2.24.23)
-- GThread : YES (ver 2.28.8)
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /usr/lib64/libz.so (ver 1.2.3)
-- JPEG: /usr/lib64/libjpeg.so (ver )
-- PNG: /usr/lib64/libpng.so (ver 1.2.49)
-- TIFF: /usr/lib64/libtiff.so (ver 42 - 3.9.4)
-- JPEG 2000: /usr/lib64/libjasper.so (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: YES (ver 2.1.2)
-- FFMPEG: YES
-- codec: YES (ver 52.72.2)
-- format: YES (ver 52.64.2)
-- util: YES (ver 50.15.1)
-- swscale: YES (ver 0.11.0)
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.29)
-- video: YES (ver 0.10.29)
-- app: YES (ver 0.10.29)
-- riff: YES (ver 0.10.29)
-- pbutils: YES (ver 0.10.29)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l1 (ver 0.6.3) / libv4l2 (ver 0.6.3)
-- XIMEA: NO
-- Xine: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use Eigen: NO
-- Use TBB: NO
-- Use OpenMP: NO
-- Use GCD NO
-- Use Concurrency NO
-- Use C=: NO
-- Use Cuda: NO
-- Use OpenCL: YES
--
-- OpenCL:
-- Version: dynamic
-- Include path: /usr/local/opencv-2.4.10/3rdparty/include/opencl/1.2
-- Use AMD FFT: NO
-- Use AMD BLAS: NO
--
-- Python:
-- Interpreter: /usr/bin/python2 (ver 2.6.6)
--
-- Java:
-- ant: NO
-- JNI: /usr/local/java/include /usr/local/java/include/linux /usr/local/java/include
-- Java tests: NO
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: NO
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- C/C++ Examples: NO
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /usr/local/opencv-2.4.10/release
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/opencv-2.4.10/release
I succeed in building and using OpenCv in Ubuntu and Windows, however in this case I have spent 2 days for fixing it. I found some suggestion about this problem may be caused by missing videodev.h, videodev2.h, however, I see that OpenCv found it in Cmake list.
My target is using OpenCv for video processing task so I am very appreciate any suggestion and solution for this problem.
Thanks all,