Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 ofvoid 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 targetall' failed make: ** [all] Error 2

Any ideas how to get this working?

click to hide/show revision 2
No.2 Revision

updated 2013-03-11 16:06:40 -0600

berak gravatar image

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 > `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 ofvoid 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&)' > /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' > `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' > `/home/Cineclick/opencv/build' > CMakeFiles/Makefile2:724: recipe for > target modules/core/CMakeFiles/opencv_core.dir/all' > `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' > `/home/Cineclick/opencv/build' > Makefile:119: recipe for targetall' target `all' > failed make: ** *** [all] Error 2

2

Any ideas how to get this working?

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
> /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&,
> `void cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool,
> bool, cv::Ptr<T> (cv::Algorithm::*)(), void
> void (cv::Algorithm::*)(const cv::Ptr<T>&),
> 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&,
> cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool,
> bool, cv::Ptr<T> (cv::Algorithm::*)(), void
> void (cv::Algorithm::*)(const cv::Ptr<T>&),
> 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,
> bool, cv::Ptr<T> (cv::Algorithm::*)(), void
> void (cv::Algorithm::*)(const cv::Ptr<T>&),
> 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:

$ mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)

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
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
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
required /home/Cineclick/opencv/modules/core/include/opencv2/core/operations.hpp:4033:
error: redefinition of `void
`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
`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:
here modules/core/CMakeFiles/opencv_core.dir/build.make:60: recipe for target
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'
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
directory `/home/Cineclick/opencv/build'
Makefile:119: recipe for target `all'
failed make: *** [all] Error 2

Any ideas how to get this working?

Edit:

$ mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)

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=/usr/i686-pc-mingw32/sys-root --with-build-sysroot=/usr/i686-pc-mingw32/sys-root --disable-multilib --disable-win32-registry --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp --disable-sjlj-exceptions --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-dwarf2 --disable-werror --enable-lto
Thread model: win32
gcc version 4.5.2 (GCC)

Edit #2:

So, I decided to install MinGW/MSys to try and fix the problem:

$ mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --wi
th-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --enable-version-specific-r
untime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)

When I run CMake, it gives the following output:

The CXX compiler identification is unknown
The C compiler identification is unknown
Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe
Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
  The C++ compiler "C:/MinGW/bin/mingw32-g++.exe" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: C:/opencv/build/CMakeFiles/CMakeTmp

Here is an image of all my cmake cached values: image link

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=/usr/i686-pc-mingw32/sys-root --with-build-sysroot=/usr/i686-pc-mingw32/sys-root --disable-multilib --disable-win32-registry --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp --disable-sjlj-exceptions --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-dwarf2 --disable-werror --enable-lto
Thread model: win32
gcc version 4.5.2 (GCC)

Edit #2:

So, I decided to install MinGW/MSys to try and fix the problem:

$ mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --wi
th-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)

When I run CMake, it gives the following output:

The CXX compiler identification is unknown
The C compiler identification is unknown
Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe
Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
  The C++ compiler "C:/MinGW/bin/mingw32-g++.exe" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: C:/opencv/build/CMakeFiles/CMakeTmp

Here is an image of all my cmake cached values: image

linkLink to image source.

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=/usr/i686-pc-mingw32/sys-root --with-build-sysroot=/usr/i686-pc-mingw32/sys-root --disable-multilib --disable-win32-registry --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp --disable-sjlj-exceptions --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-dwarf2 --disable-werror --enable-lto
Thread model: win32
gcc version 4.5.2 (GCC)

Edit #2:

So, I decided to install MinGW/MSys to try and fix the problem:

$ mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --wi
th-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)

When I run CMake, it gives the following output:

The CXX compiler identification is unknown
The C compiler identification is unknown
Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe
Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
  The C++ compiler "C:/MinGW/bin/mingw32-g++.exe" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: C:/opencv/build/CMakeFiles/CMakeTmp

Here is an image of all my cmake cached values: image

Link to image source.

Edit #3:

Did a fresh install of cygwin, everything worked fine, however, now it can't find my webcam, which is an essential part of the project. Is there some sort of flag i can pass to make cygwin use mingw/windows (which I assume isn't happening)? With a configure script, I understand I could use a --target= flag, but I'm not sure how to approach this in cygwin.