Ask Your Question

Revision history [back]

OpenCV v3.0, VS 2013.

This error comes from the conflict of "min", and "min" is defined in both minwindef.h and limit. ("c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\limits")

So, I undefined min at minwindef.h. which is in ..\OpenCV\opencv\modules\videoio\src\precomp.hpp.

I added below lines to precomp.hpp: ..\OpenCV\opencv_contrib\modules\text\src\precomp.hpp

if defined WIN32 || defined WINCE

#if !defined _WIN32_WINNT
    #ifdef HAVE_MSMF
        #define _WIN32_WINNT 0x0600 // Windows Vista
    #else
        #define _WIN32_WINNT 0x0500 // Windows 2000
    #endif
#endif

#include <windows.h>
#undef small
#undef min
#undef max
#undef abs

endif