消息关闭
    暂无新消息!
在pro中已经添加如下代码
INCLUDEPATH+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\include\opencv2
INCLUDEPATH+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\include\opencv
INCLUDEPATH+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\include

LIBS+=  D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_calib3d320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_core320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_features2d320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_flann320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_highgui320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_imgcodecs320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_imgproc320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_ml320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_objdetect320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_photo320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_shape320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_stitching320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_superres320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_video320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_videoio320.dll.a
LIBS+= D:\OpenCV\Opencv3.2_mingw5.3.0\install\x86\mingw\lib\libopencv_videostab320.dll.a
声明的是,mingw是直接自己用积分从网站上下的
然后程序一旦运行就直接异常结束
Starting C:\Users\Administrator\Desktop\QT\build-untitled34-Desktop_Qt_5_8_0_MinGW_32bit-Debug\debug\untitled34.exe...
程序异常结束。
C:\Users\Administrator\Desktop\QT\build-untitled34-Desktop_Qt_5_8_0_MinGW_32bit-Debug\debug\untitled34.exe crashed.

2个回答

︿ 2
我前一段时间 刚弄了,没有任何难度,唯一不同的是,Opencv我是自己编译的。cmake就两条命令。
︿ 0
编译通过了,但是运行的时候粗问题了吧.
提供三个步骤
1.把libopencv*.dll和相应的依赖都 拷贝到你的exe目录里面.
2.如果上面的依赖找全了,还是崩溃,那么再把Qt相关的库拷贝到exe目录,点击运行exe,它会提示你少了什么.一个一个的找全.
3.如果上面的步骤都不能起作用,那么恭喜你, 基本可以排除目录问题,很可能是你的opencv的版本和mingw或者Qt库不兼容.你需要自己编译opencv.

以上,好运.