Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 编译QT的opencv时出错_Windows_Opencv_Compilation_Cmake_Qt5 - Fatal编程技术网

Windows 编译QT的opencv时出错

Windows 编译QT的opencv时出错,windows,opencv,compilation,cmake,qt5,Windows,Opencv,Compilation,Cmake,Qt5,我想在QT中使用opencv,所以我必须用mingw编译它。当我想用cmake2.8.10.2编译它时,它有以下错误 The CXX compiler identification is GNU 4.7.2 The C compiler identification is GNU 4.7.2 Check for working CXX compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe Check for working CXX compiler: C

我想在
QT
中使用
opencv
,所以我必须用
mingw
编译它。当我想用
cmake2.8.10.2
编译它时,它有以下错误

The CXX compiler identification is GNU 4.7.2
The C compiler identification is GNU 4.7.2
Check for working CXX compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe
Check for working CXX compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
      The C++ compiler "C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe" is not able to
      compile a simple test program.

      It fails with the following output:

       Change Dir: C:/opencv_bin/CMakeFiles/CMakeTmp



      Run Build Command:C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make.exe
      "cmTryCompileExec2270185098/fast"

      C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make.exe -f
      CMakeFiles\cmTryCompileExec2270185098.dir\build.make
      CMakeFiles/cmTryCompileExec2270185098.dir/build

      mingw32-make.exe[1]: Entering directory
      'C:/opencv_bin/CMakeFiles/CMakeTmp'

      "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_progress_report
      C:\opencv_bin\CMakeFiles\CMakeTmp\CMakeFiles 1

      'C:\Users\' is not recognized as an internal or external command,

      operable program or batch file.

      CMakeFiles\cmTryCompileExec2270185098.dir\build.make:59: recipe for target
      'CMakeFiles/cmTryCompileExec2270185098.dir/testCXXCompiler.cxx.obj' failed

      mingw32-make.exe[1]: ***
      [CMakeFiles/cmTryCompileExec2270185098.dir/testCXXCompiler.cxx.obj] Error
      1

      mingw32-make.exe[1]: Leaving directory 'C:/opencv_bin/CMakeFiles/CMakeTmp'

      makefile:116: recipe for target 'cmTryCompileExec2270185098/fast' failed

      mingw32-make.exe: *** [cmTryCompileExec2270185098/fast] Error 2





      CMake will not be able to correctly generate this project.
    Call Stack (most recent call first):
      CMakeLists.txt:61 (project)


    Configuring incomplete, errors occurred!

有什么想法吗?

我有一个更新的版本,但在我的情况下,你应该尝试在qtsk/minGW/bin文件夹中而不是Qt文件夹中

您是否有文件“C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe”?如果是Cmake或OpenCV,则为较新版本?请解释有关QtSDK/MinGW/bin的更多信息请尝试下载页面上的第一个选项:例如: