Qt添加opencv库

下载编译好的opencv库(这里以32位为例):[https://github.com/huihut/OpenCV-MinGW-Build/tree/OpenCV-3.3.1]

下载完成后在.pro文件中添加下列代码:

win32 {
INCLUDEPATH += H:\OpenCV-MinGW-Build-OpenCV-3.3.1\include\
INCLUDEPATH += H:\OpenCV-MinGW-Build-OpenCV-3.3.1\include\opencv
INCLUDEPATH += H:\OpenCV-MinGW-Build-OpenCV-3.3.1\include\opencv2
LIBS += H:\OpenCV-MinGW-Build-OpenCV-3.3.1\bin\libopencv_*.dll
}

添加完成后,将.dll文件复制一份到编译出的.exe文件夹中
在这里插入图片描述

你可能感兴趣的:(Qt,qt,opencv,dll)