I am unable to build opencv using mingw codeblocks.?(totally a beginner) [closed]

asked 2016-10-09 10:28:24 -0600

pong gravatar image

updated 2016-10-09 10:30:52 -0600

berak gravatar image
 D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:51:6: warning: "_WIN32_IE" is not defined [-Wundef]
 #if (_WIN32_IE < 0x0500)
      ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:52:99: note: #pragma message: WARNING: Win32 UI needs to be compiled with _WIN32_IE >= 0x0500 (_WIN32_IE_IE50)
 #pragma message("WARNING: Win32 UI needs to be compiled with _WIN32_IE >= 0x0500 (_WIN32_IE_IE50)")
                                                                                                   ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp: In function 'void cvSetModeWindow_W32(const char*, double)':
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:474:47: error: 'MONITOR_DEFAULTTONEAREST' was not declared in this scope
             hMonitor = MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST);
                                               ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:474:71: error: 'MonitorFromRect' was not declared in this scope
             hMonitor = MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST);
                                                                       ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp: In function 'LRESULT MainWindowProc(HWND, UINT, WPARAM, LPARAM)':
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:1377:45: error: 'MONITOR_DEFAULTTONEAREST' was not declared in this scope
           hMonitor = MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST);
                                             ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:1377:69: error: 'MonitorFromRect' was not declared in this scope
           hMonitor = MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST);
                                                                     ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp: In function 'LRESULT HighGUIProc(HWND, UINT, WPARAM, LPARAM)':
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:1549:24: warning: left operand of comma operator has no effect [-Wunused-value]
             } while (0,0); // (0,0) instead of (0) to avoid MSVC compiler warning C4127: "conditional expression is constant"
                        ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp: In function 'int icvCreateTrackbar(const char*, const char*, int*, int, CvTrackbarCallback, CvTrackbarCallback2, void*)':
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::iBitmap' [-Wmissing-field-initializers]
         TBBUTTON tbs = {};
                         ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::idCommand' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::fsState' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::fsStyle' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::bReserved' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::dwData' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2041:25: warning: missing initializer for member '_TBBUTTON::iString' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing initializer for member 'TBBUTTONINFOA::cbSize' [-Wmissing-field-initializers]
         TBBUTTONINFO tbis = {};
                              ^
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing initializer for member 'TBBUTTONINFOA::dwMask' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing initializer for member 'TBBUTTONINFOA::idCommand' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing initializer for member 'TBBUTTONINFOA::iImage' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing initializer for member 'TBBUTTONINFOA::fsState' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing initializer for member 'TBBUTTONINFOA::fsStyle' [-Wmissing-field-initializers]
D:\opencv\opencv-master\modules\highgui\src\window_w32.cpp:2042:30: warning: missing ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-19 07:07:53.084634

Comments

1

your compiler is just not supported by opencv devs (they gave up on this long ago)

if you're a n00b, do yourself a favour, ditch the whole codeblocks/mingw idea entirely and get visual studio community (huge download though) there are prebuilt libs for this on sourceforge.

if you have to use mingw, please try with mingw-64 instead.

again, you won't get anywhere with your current setup.

berak gravatar imageberak ( 2016-10-09 10:32:21 -0600 )edit