Can';t在Windows上构建OpenCV 3.1(使用MinGW)

Can';t在Windows上构建OpenCV 3.1(使用MinGW),opencv,build,Opencv,Build,我需要从源代码构建OpenCV,因为我想对其进行修改。所以使用预构建的二进制文件对我来说不是一个选择。我在Windows8上做这个。我没有MS Visual Studio,也不想使用它 以下是我如何重现生成错误: I git克隆 我使用CMake 3.7.1,按配置,然后按生成。它似乎有效(没有错误)。我将输出文件夹命名为opencv/release 我转到opencv/release文件夹,键入mingw32-make 最终,编译一段时间后,它会显示以下错误消息: Building CXX o

我需要从源代码构建OpenCV,因为我想对其进行修改。所以使用预构建的二进制文件对我来说不是一个选择。我在Windows8上做这个。我没有MS Visual Studio,也不想使用它

以下是我如何重现生成错误:

  • I git克隆
  • 我使用CMake 3.7.1,按配置,然后按生成。它似乎有效(没有错误)。我将输出文件夹命名为opencv/release
  • 我转到opencv/release文件夹,键入mingw32-make 最终,编译一段时间后,它会显示以下错误消息:

    Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
    modules\core\src\parallel.cpp:135:43: error: operator '&&' has no right operand
    modules\core\src\parallel.cpp: In function 'void cv::parallel_for_(const cv::Range&, const cv::ParallelLoopBody&, double)':
    modules\core\src\parallel.cpp:311:52: error: 'parallel_for_pthreads' was not declared in this scope parallel_for_pthreads(range, body, nstripes);
                                                    ^
    modules\core\src\parallel.cpp: In function 'int cv::getNumThreads()':
    modules\core\src\parallel.cpp:370:50: error: 'parallel_pthreads_get_threads_num' was not declared in this scope return parallel_pthreads_get_threads_num();
                                                  ^
    modules\core\src\parallel.cpp: In function 'void cv::setNumThreads(int)':
    modules\core\src\parallel.cpp:431:46: error: 'parallel_pthreads_set_threads_num' was not declared in this scope parallel_pthreads_set_threads_num(threads);
                                              ^
    modules\core\CMakeFiles\opencv_core.dir\build.make:990: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
    
    注意:我尝试在有TPP和没有TPP的情况下编译(在CMake配置中),得到了相同的错误消息

    此外,我还阅读了有关StackOverflow的其他类似问题,但答案没有帮助