After i followed this below
Download the OpenCV source files.
Unpack to C:\opencv (or a folder of your choice)
Open CMake and select source (directory of 2.) and build for example C:\opencv\mingw-build
Click Configure and select MinGW Makefiles. (If you experience problems, ensure that the minGW/bin directory is added to the evironment path labelled, 'PATH') Wait for the configuration to be done, edit your properties of your needs (in my case I don't need tests, docs and python). enter image description here Click Configure again. When everything is white click Generate else edit the red fields.
open cmd and dir to build directory of 3.
Run mingw32-make.
Around 35-40% I get this error, and it stops
C:\opencv\sources\modules\ts\src\ts_gtest.cpp: In constructor 'testing::internal::Mutex::Mutex()':
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8829:45: error: cannot convert 'CRITICAL_SECTION* {aka _CRITICAL_SECTION*}' to '_RTL_CRITICAL_SECTION*' in initialization
critical_section_(new CRITICAL_SECTION) {
^
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8830:48: error: cannot convert '_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for argument '1' to 'void InitializeCriticalSection(LPCRITICAL_SECTION)'
::InitializeCriticalSection(critical_section_);
^
C:\opencv\sources\modules\ts\src\ts_gtest.cpp: In destructor 'testing::internal::Mutex::~Mutex()':
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8840:46: error: cannot convert '_RTL_CRITICAL_SECTION*' to 'PCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for argument '1' to 'void DeleteCriticalSection(PCRITICAL_SECTION)'
::DeleteCriticalSection(critical_section_);
^
C:\opencv\sources\modules\ts\src\ts_gtest.cpp: In member function 'void testing::internal::Mutex::Lock()':
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8848:43: error: cannot convert '_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for argument '1' to 'void EnterCriticalSection(LPCRITICAL_SECTION)'
::EnterCriticalSection(critical_section_);
^
C:\opencv\sources\modules\ts\src\ts_gtest.cpp: In member function 'void testing::internal::Mutex::Unlock()':
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8858:43: error: cannot convert '_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for argument '1' to 'void LeaveCriticalSection(LPCRITICAL_SECTION)'
::LeaveCriticalSection(critical_section_);
^
C:\opencv\sources\modules\ts\src\ts_gtest.cpp: In member function 'void testing::internal::Mutex::ThreadSafeLazyInit()':
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8879:27: error: cannot convert 'CRITICAL_SECTION* {aka _CRITICAL_SECTION*}' to '_RTL_CRITICAL_SECTION*' in assignment
critical_section_ = new CRITICAL_SECTION;
^
C:\opencv\sources\modules\ts\src\ts_gtest.cpp:8880:54: error: cannot convert '_RTL_CRITICAL_SECTION*' to 'LPCRITICAL_SECTION {aka _CRITICAL_SECTION*}' for argument '1' to 'void InitializeCriticalSection(LPCRITICAL_SECTION)'
::InitializeCriticalSection(critical_section_);
^
modules\ts\CMakeFiles\opencv_ts.dir\build.make:237: recipe for target 'modules/ts/CMakeFiles/opencv_ts.dir/src/ts_gtest.cpp.obj' failed
mingw32-make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts_gtest.cpp.obj] Error 1
CMakeFiles\Makefile2:5379: recipe for target 'modules/ts/CMakeFiles/opencv_ts.dir/all' failed
mingw32-make[1]: *** [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
os:Windows 10 64 bit
What should i do?