Linking QtCreator && OpenCv

南笙酒味 提交于 2019-12-06 16:39:37

Which version of Opencv is this? I suggest trying latest 2.3, and using CMake instead of .pro files, which is the build system for the overall project.

Then you just file->open-project on the CMakeLists.txt, and you can just look at how examples are set up with CMake.

If this is latest, then 1) highgui uses QT so it makes sense that it might play nicer with qt creator and 2) building with .pro on windows might be untested; a unavoidable need for CMake would not be surprising.

Edit: Look at the CMakeLists.txt files for the libraries ....

# CMakeLists.txt for /modules/highgui
 #YV
if (HAVE_QT)
if (HAVE_QT_OPENGL)
    set(QT_USE_QTOPENGL TRUE)
endif()
INCLUDE(${QT_USE_FILE})

SET(_RCCS_FILES src/window_QT.qrc)
QT4_ADD_RESOURCES(_RCC_OUTFILES ${_RCCS_FILES})

SET(_MOC_HEADERS src/window_QT.h )
QT4_WRAP_CPP(_MOC_OUTFILES ${_MOC_HEADERS})

set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY})
set(highgui_srcs ${highgui_srcs} src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES} )
endif()

if(WIN32)
   if(NOT HAVE_QT)
      set(highgui_srcs ${highgui_srcs} src/window_w32.cpp)
   endif()
  set(highgui_srcs ${highgui_srcs} src/cap_vfw.cpp src/cap_cmu.cpp   src/cap_dshow.cpp)
   if(HAVE_MIL)

    set(highgui_srcs ${highgui_srcs} src/cap_mil.cpp)
endif()
endif()

if(UNIX)
if(NOT HAVE_QT)        
    if(HAVE_GTK)
        set(highgui_srcs ${highgui_srcs} src/window_gtk.cpp)
    endif()
endif()
 ....
endif()

But "imgproc"'s CMakeLists.txt doesn't do any specific checks ... just passes the buck to main opencv lib:

 define_opencv_module(imgproc opencv_core)

Shouldn't you be using the MSVC version of Qt then?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!