Building OpenCV from git on CygWin
Here is my build log:
[ 14%] Building CXX object
modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o
cd /home/Cineclick/opencv/build/modules/core && /usr/bin/c++.exe -Dopencv_core_EXPORTS -DHAVE_CVCONFIG_H -DHAVE_QT -DHAVE_QT_OPENGL -DCVAPI_EXPORTS -W -Wall -Wformat -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -march=i686 -fomit-frame-pointer -msse -msse2 -msse3 -mfpmath=sse -ffunction-sections -O2 -DNDEBUG -DNDEBUG -I/home/Cineclick/opencv/modules/core/test
-I/home/Cineclick/opencv/modules/features2d/include
-I/home/Cineclick/opencv/modules/highgui/include
-I/home/Cineclick/opencv/modules/flann/include
-I/home/Cineclick/opencv/modules/imgproc/include
-I/home/Cineclick/opencv/modules/core/include
-I/home/Cineclick/opencv/modules/ts/include
-I/home/Cineclick/opencv/build/modules/core
-I/home/Cineclick/opencv/modules/core/src
-I/home/Cineclick/opencv/modules/gpu/include
-I/home/Cineclick/opencv/build -o CMakeFiles/opencv_core.dir/src/algorithm.cpp.o
-c /home/Cineclick/opencv/modules/core/src/algorithm.cpp
In file included from
/home/Cineclick/opencv/modules/core/include/opencv2/core/core.hpp:4691,
from /home/Cineclick/opencv/modules/core/src/precomp.hpp:50,
from /home/Cineclick/opencv/modules/core/src/algorithm.cpp:43:
/home/Cineclick/opencv/modules/core/include/opencv2/core/operations.hpp:4024:
error: got 2 template parameters for `void cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool, cv::Ptr<T> (cv::Algorithm::*)(), void (cv::Algorithm::*)(const cv::Ptr<T>&), const std::string&)'
/home/Cineclick/opencv/modules/core/include/opencv2/core/operations.hpp:4024:
error: but 1 required /home/Cineclick/opencv/modules/core/include/opencv2/core/operations.hpp:4033:
error: redefinition of `void cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool, cv::Ptr<T> (cv::Algorithm::*)(), void (cv::Algorithm::*)(const cv::Ptr<T>&), const std::string&)'
/home/Cineclick/opencv/modules/core/include/opencv2/core/operations.hpp:4024:
error: `void cv::AlgorithmInfo::addParam(cv::Algorithm&,
const char*, cv::Ptr<T>&, bool, cv::Ptr<T> (cv::Algorithm::*)(), void (cv::Algorithm::*)(const cv::Ptr<T>&), const std::string&)' previously
declared here modules/core/CMakeFiles/opencv_core.dir/build.make:60: recipe for target `modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o'
failed make[2]: ***
[modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.o]
Error 1 make[2]: Leaving directory
`/home/Cineclick/opencv/build'
CMakeFiles/Makefile2:724: recipe for target `modules/core/CMakeFiles/opencv_core.dir/all' failed make[1]: ***
[modules/core/CMakeFiles/opencv_core.dir/all]
Error 2 make[1]: Leaving directory `/home/Cineclick/opencv/build'
Makefile:119: recipe for target `all'
failed make: *** [all] Error 2
Any ideas how to get this working?
Edit:
$ /usr/bin/i686-pc-mingw32-c++ -v
Using built-in specs.
COLLECT_GCC=/usr/bin/i686-pc-mingw32-c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-mingw32/4.5.2/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: /usr/src/packages/mingw-gcc/mingw-gcc-4.5.2-1/src/gcc-4.5.2/configure --srcdir=/usr/src/packages/mingw-gcc/mingw-gcc-4.5.2-1/src/gcc-4.5.2 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/mingw-gcc -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-mingw32 --with-sysroot ...
could you please add the mingw version ?
Updated with my mingw32 compiler version.
nice that you got it to compile.
what do you mean by "now it can't find my webcam" ?
is it a 'special' one, like Ximea ?
(if that's the case, you could rerun cmake-gui to set the missing options)
but for an ordinary, off-the-shelf device, you don't need to specify anything at compile time.
It's just a regular usb webcam. I did some googling and it suggested that my usb webcam is not reachable through cygwin since it won't detect dshow or videoInput as valid options.
ah, ok. so no dshow for mingw or cygwin, even. (yes, that videoInput.lib comes precompiled as a .lib file, so vs only) you could still try if the vfw capture works for you:
look at cvCreateCameraCapture(), modules/highgui/src/cap.cpp ~ L 113