标签:
CMake Error atC:/CMake/share/cmake-3.0/Modules/FindQt4.cmake:1316 (message): Found unsuitable Qt version "" from NOTFOUND, this coderequires Qt 4.x Call Stack (most recent call first): cmake/OpenCVFindLibsGUI.cmake:34 (find_package) CMakeLists.txt:466 (include) 找到QT_QMAKE_EXECUTABLE,它的值填写为:D:/work/qt/5.5/mingw492_32/bin/qmake.exe 将Qt5Concurrent_DIR,Qt5Core_DIR,Qt5Gui_DIR,Qt5Test_DIR,Qt5Widgets_DIR,Qt5OpenGL_DIR,它们的Value分别填写为: D:/work/qt/5.5/mingw492_32/lib/cmake/Qt5Concurrent D:/work/qt/5.5/mingw492_32/lib/cmake/Qt5Core D:/work/qt/5.5/mingw492_32/lib/cmake/Qt5Gui D:/work/qt/5.5/mingw492_32/lib/cmake/Qt5Test D:/work/qt/5.5/mingw492_32/lib/cmake/Qt5Widgets D:/work/qt/5.5/mingw492_32/lib/cmake/Qt5OpenGL 再次Configure,这时配置完成,不会出现任何错误提示。虽然会有许多警告,但不用去管,按Generate。Generate完成后,关闭CMake窗口。
这样makefile文件就生成了。
打开它并找到 add_extra_compiler_option(-Werror=non-virtual-dtor) 将它注释掉,变成: #add_extra_compiler_option(-Werror=non-virtual-dtor)
INCLUDEPATH+=D:\work\opencv\necessary_file\include\opencv D:\work\opencv\necessary_file\include\opencv2 D:\work\opencv\necessary_file\include
LIBS += -L D:\work\opencv\necessary_file\lib\libopencv_*.a
#include "cv.h" #include "cxcore.h" #include "highgui.h" int main(int argc,char *argv[]) { //声明IplImage指针 IplImage*pImg; //载入图片 pImg=cvLoadImage("E:/1.jpg",1); //创建窗口 cvNamedWindow("Image",1); //显示图像 cvShowImage("Image",pImg); //等待按键 cvWaitKey(0); //销毁窗口 cvDestroyWindow("Image"); //释放图像 cvReleaseImage(&pImg); return 0; }
参考:
1、http://blog.csdn.net/zhaocj/article/details/38944037
2、http://www.mamicode.com/info-detail-500574.html
3、http://blog.csdn.net/qiurisuixiang/article/details/8665278
2015-07-18
标签:
原文地址:http://www.cnblogs.com/ddblog/p/4656847.html