在opencv\sources\modules\ts\include\opencv2\ts\的文件夾下找到ts_gtest.h文件下:
將<code>
struct _RTL_CRITICAL_SECTION;
</code>修改為
<code>
#if GTEST_OS_WINDOWS_MINGW
// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
// separate (equivalent) structs, instead of using typedef
typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#else
// Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
// This assumption is verified by
// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION
typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#endif
</code>
同時
<code>
RTL_CRITICAL_SECTION* critical_section;
</code>
修改為
<code>
GTEST_CRITICAL_SECTION* critical_section_;
</code>