Search code examples
opencvwindows-8.1mingw32opencv3.0

OpenCV Win8.1 minGW32 source-code error: 'TBBUTTONINFO' was not declared in this scope


I am trying to use OpenCV3-beta in Eclipse under Win8.1 and have to build source from git since there are no minGW libs available for download. It was ok before, but today (just now) I updated all OpenCV3 sources from git-master and now mingw32-make suddenly fails with message:

\git\opencv\modules\highgui\src\window_w32.cpp:2011:9: error: 'TBBUTTONINFO' was not declared in this scope

The code itself is:

trackbar = icvFindTrackbarByName(window,trackbar_name);
if( !trackbar ){
    TBBUTTON tbs = {0};
    TBBUTTONINFO tbis = {0};
    ...

It is not the only error, there are some other errors which are similar to mentioned above:

\git\opencv\modules\highgui\src\window_w32.cpp:2023:81: error: 'BTNS_AUTOSIZE' was not declared in this scope

\git\opencv\modules\highgui\src\window_w32.cpp:2023:97: error: 'BTNS_BUTTON' was not declared in this scope

It is impossible to uncheck highgui module in makefile and compile OpenCV due to a plenty of useful modules dependencies.

UPDATE Guess it is a bug. Reported here: http://code.opencv.org/issues/4087


Solution

  • The problem (according to Artur Wieczorek) is OS version set by MinGW by default. To cure it find "commctrl.h" in MinGW directory and something like

    #if 0
    #define _WIN32_IE   0x0300
    #endif
    

    then change it to

    #if 1
    #define _WIN32_IE   0x0500
    #endif