opencv - cmake mingw32-make错误

时间:2017-07-09 18:08:29

标签: c++ opencv cmake

我跟着下面这个

下载OpenCV源文件。

解压缩到C:\ opencv(或您选择的文件夹)

打开CMake并选择source(目录为2.)并构建例如C:\ opencv \ mingw-build

单击“配置”并选择“MinGW Makefile”。 (如果遇到问题,请确保将minGW / bin目录添加到标记为“PATH”的环境路径中) 等待配置完成,编辑您需要的属性(在我的情况下,我不需要测试,文档和python)。 在此处输入图像说明再次单击“配置当一切都是白色时,单击Generate else编辑红色字段。

打开cmd和dir构建目录3。

运行mingw32-make。

大约35-40%我收到此错误,并停止

    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位

我该怎么办?

0 个答案:

没有答案