QT编译opencv时出错 [英] error while compiling opencv for QT

查看:385
本文介绍了QT编译opencv时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在QT中使用opencv,所以我必须使用mingw进行编译.当我想用CMake 2.8.10.2编译它时,出现以下错误

i want to use opencv in QT, so i must compile it with mingw. When i want to compile it with CMake 2.8.10.2 it has following error

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!

有什么主意吗?

推荐答案

我有较新的版本,但就我而言,您应该尝试使用QtSDK/minGW/bin文件夹而不是Qt文件夹.

I have a newer version but in my case you should try in the folder QtSDK/minGW/bin instead of Qt folder.

这篇关于QT编译opencv时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆