I just installed Qt 5.15
and is testing how it works with opencv. I downloaded prebuild Opencv4.3, and set up a .pri
file for being deployed in Qt.
The include and libs are as follows in the .pri
file:
INCLUDEPATH += C:/opencv/opencv-4.3.0-prebuild/include
CONFIG(release, debug|release):{
LIBS += -LC:/opencv/opencv-4.3.0-prebuild/x64/vc14/lib \
-lopencv_world430
}
CONFIG(debug, debug|release):{
LIBS += -LC:/opencv/opencv-4.3.0-prebuild/x64/vc14/lib \
-lopencv_world430d
}
Then I run a simple image display domo:
#include "opencv2/opencv.hpp"
using namespace cv;
Mat img = imread("image.png");
if(img.empty())
{
qDebug()<<"Could not find the image";
}
else
{
namedWindow("Image");
imshow("Image", img);
}
The resulting error message: The program has unexpectedly finished. The process was ended forcefully.
Without linking with OpenCV, Qt itself works just fine.
What causes the problem?