I got this problem when trying to compile opencv using Cmake and mingw.
for Cmake: sourcecode is located in "C:\CPP Libraries\OpenCV-2.4.13\opencv\sources" where the binaries are goint to be build is in: "C:/CPP Libraries/OpenCV-2.4.13/opencv/build/x64/mingw"
I've already used Cmake to generate the makefile.
when i run the makefile:
C:\CPP Libraries\OpenCV-2.4.13\opencv\build\x64\mingw>mingw32-make
this is the output that I get after 31%
[ 31%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_w32.cpp.obj
C:\CPP Libraries\OpenCV-2.4.13\opencv\sources\modules\highgui\src\window_w32.cpp: In function 'int icvCreateTrackbar(const char*, const char*, int*, int, CvTrackbarCallback, CvTrackbarCallback2, void*)':
C:\CPP Libraries\OpenCV-2.4.13\opencv\sources\modules\highgui\src\window_w32.cpp:1853:81: error: 'BTNS_AUTOSIZE' was not declared in this scope
WS_CHILD | CCS_TOP | TBSTYLE_WRAPABLE | BTNS_AUTOSIZE | BTNS_BUTTON,
^
C:\CPP Libraries\OpenCV-2.4.13\opencv\sources\modules\highgui\src\window_w32.cpp:1853:97: error: 'BTNS_BUTTON' was not declared in this scope
WS_CHILD | CCS_TOP | TBSTYLE_WRAPABLE | BTNS_AUTOSIZE | BTNS_BUTTON,
^
modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:187: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_w32.cpp.obj' failed
mingw32-make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_w32.cpp.obj] Error 1
CMakeFiles\Makefile2:2203: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed
mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Does anyone knows a solution, because i have no clue about this one.
//EDIT!
After downloaded the version from the git repository and try to build it i got these other errors. I already try to change #define _WIN32_IE 0x0300 to #define _WIN32_IE 0x0500 in "commctrl.h" in MinGW directory, but it didn't worl.
C:\CPP Libraries\OpenCV-2.4.13\Git\opencv\build\x64\mingw>mingw32-make
[ 2%] Built target zlib
[ 6%] Built target libtiff
[ 11%] Built target libjpeg
[ 16%] Built target libwebp
[ 19%] Built target libjasper
[ 20%] Built target libpng
[ 26%] Built target IlmImf
[ 26%] Built target opencv_core_pch_dephelp
[ 26%] Built target pch_Generate_opencv_core
[ 26%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
C:\CPP Libraries\OpenCV-2.4.13\Git\opencv\modules\core\src\parallel.cpp: In function 'int cv::getThreadNum()':
C:\CPP Libraries\OpenCV-2.4.13\Git\opencv\modules\core\src\parallel.cpp:474:45: error: 'pthread_self' was not declared in this scope
return (int)(size_t)(void*)pthread_self(); // no zero-based indexing
^
modules\core\CMakeFiles\opencv_core.dir\build.make:990: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed
mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
CMakeFiles\Makefile2:1473: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
1337in your post idpthread_self(). Seems this hasn't been fixed in later versions - assuming it is an openCV problem (vs. a MinGW problem).