2014-11-11 2 views
3

Qt 생성자를 연결하기 위해 opencv 라이브러리를 구성한 다음 생성하고 싶습니다. cmake 3.1.0을 열고 소스를 입력하고 경로를 작성했습니다.qt 작성자 opencv windows cmake 오류

소스 :


C:/Users/Philipp_Laptop/Downloads/opencv/sources 
build: C:/opencv-mingw 
그런 다음 나는 경로로와 Mingw 컴파일러 구성 : 내가 with_Qt 옵션을 설정

C:/Qt/Tools/mingw482_32/bin/gcc.exe 
C:/Qt/Tools/mingw482_32/bin/g++.exe 

성공적으로 구성한 후. 나는 두 번을 구성하고 그것은 나에게 다음과 같은 오류를 보여줍니다


Detected version of GNU GCC: 48 (408) 
CMake Warning (dev) at cmake/OpenCVUtils.cmake:261 (if): 
    Policy CMP0054 is not set: Only interpret if() arguments as variables or 
    keywords when unquoted. Run "cmake --help-policy CMP0054" for policy 
    details. Use the cmake_policy command to set the policy and suppress this 
    warning. 

    Quoted variables like "WIN32" will no longer be dereferenced when the 
    policy is set to NEW. Since the policy is not set the OLD behavior will be 
    used. 
Call Stack (most recent call first): 
    CMakeLists.txt:127 (OCV_OPTION) 
This warning is for project developers. Use -Wno-dev to suppress it. 

CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package): 
    By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has 
    asked CMake to find a package configuration file provided by "Qt5Core", but 
    CMake did not find one. 

    Could not find a package configuration file provided by "Qt5Core" with any 
    of the following names: 

    Qt5CoreConfig.cmake 
    qt5core-config.cmake 

    Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set 
    "Qt5Core_DIR" to a directory containing one of the above files. If 
    "Qt5Core" provides a separate development package or SDK, be sure it has 
    been installed. 
Call Stack (most recent call first): 
    CMakeLists.txt:447 (include) 


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package): 
    By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has 
    asked CMake to find a package configuration file provided by "Qt5Gui", but 
    CMake did not find one. 

    Could not find a package configuration file provided by "Qt5Gui" with any 
    of the following names: 

    Qt5GuiConfig.cmake 
    qt5gui-config.cmake 

    Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set 
    "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui" 
    provides a separate development package or SDK, be sure it has been 
    installed. 
Call Stack (most recent call first): 
    CMakeLists.txt:447 (include) 


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): 
    By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project 
    has asked CMake to find a package configuration file provided by 
    "Qt5Widgets", but CMake did not find one. 

    Could not find a package configuration file provided by "Qt5Widgets" with 
    any of the following names: 

    Qt5WidgetsConfig.cmake 
    qt5widgets-config.cmake 

    Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set 
    "Qt5Widgets_DIR" to a directory containing one of the above files. If 
    "Qt5Widgets" provides a separate development package or SDK, be sure it has 
    been installed. 
Call Stack (most recent call first): 
    CMakeLists.txt:447 (include) 


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package): 
    By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has 
    asked CMake to find a package configuration file provided by "Qt5Test", but 
    CMake did not find one. 

    Could not find a package configuration file provided by "Qt5Test" with any 
    of the following names: 

    Qt5TestConfig.cmake 
    qt5test-config.cmake 

    Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set 
    "Qt5Test_DIR" to a directory containing one of the above files. If 
    "Qt5Test" provides a separate development package or SDK, be sure it has 
    been installed. 
Call Stack (most recent call first): 
    CMakeLists.txt:447 (include) 


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package): 
    By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this 
    project has asked CMake to find a package configuration file provided by 
    "Qt5Concurrent", but CMake did not find one. 

    Could not find a package configuration file provided by "Qt5Concurrent" 
    with any of the following names: 

    Qt5ConcurrentConfig.cmake 
    qt5concurrent-config.cmake 

    Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set 
    "Qt5Concurrent_DIR" to a directory containing one of the above files. If 
    "Qt5Concurrent" provides a separate development package or SDK, be sure it 
    has been installed. 
Call Stack (most recent call first): 
    CMakeLists.txt:447 (include) 


Looking for Q_WS_X11 
Looking for Q_WS_X11 - not found 
Looking for Q_WS_WIN 
Looking for Q_WS_WIN - found 
Looking for Q_WS_QWS 
Looking for Q_WS_QWS - not found 
Looking for Q_WS_MAC 
Looking for Q_WS_MAC - not found 
Found OpenGL: opengl32 
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 (message): 
    Could NOT find Qt4 (missing: QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE 
    QT_QTTEST_LIBRARY QT_UIC_EXECUTABLE) (found version "4.8.6") 
Call Stack (most recent call first): 
    C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE) 
    C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindQt4.cmake:1331 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) 
    cmake/OpenCVFindLibsGUI.cmake:34 (find_package) 
    CMakeLists.txt:447 (include) 


Configuring incomplete, errors occurred! 
See also "C:/opencv-mingw/CMakeFiles/CMakeOutput.log". 
See also "C:/opencv-mingw/CMakeFiles/CMakeError.log". 

답변

4

내가 그래서이 방법을 참조 것이 Windows에서 CMake GUI을 사용했다. CMAKE_PREFIX_PATH not defined과 관련된 문제부터 살펴 보겠습니다. 는 단순히 를 눌러야 할이가 CMAKE GUI을 추가하고 값 C:/Bin/Qt/5.3/mingw482_32/lib/cmake/CMAKE_PREFIX_PATH라는 이름의 형 PATH의 변수를 추가 해결하지만 의 자신의 설치 Qt5를 사용합니다. 현재 디렉토리에 필요한 모든 모듈이 있습니다 : Qt5 디렉토리, Qt5AxBase ...

이 시점에서 구성을 누르면 QT_QMAKE_EXECUTABLE이 유효하지 않습니다. 제 경우에는 올바르게 설정해야합니다 : C:/Bin/Qt/5.3/mingw482_32/bin/qmake.exe.

그런 다음 구성을 다시 누르고 일부 오류가 여전히 남아 있는지 확인하십시오 (이전에 보지 못한 오류가 있었지만 이전 매개 변수의 결과 일 수 있음). 내 경우에는이 문제가 모두 해결되어 빌드가 진행되었습니다. 난 그냥 CMAKE에서 첫 번째 항목으로 PAT 변수에 빈는 MinGW 경로를 넣고 기본 컴파일러를 사용하여 약간 다른했다 (하지만 해결책은 내 하나뿐 유효) :

는 MinGW 구성은 잘 될 것 같다 .

+1

우분투는 어떻게 이러한 모듈을 찾습니까? 우분투에서'CMAKE_PREFIX_PATH'를 지정하지 않았습니다. – user2023370