As my guess, there may be a linkage problem. For release mode you need to link with release static libraries
For example, if a debug library is opencv_imgproc243d.lib
, its release version is opencv_imgproc243.lib
Opencv Sample code not working in Visual studio
-
01-06-2022 - |
Вопрос
I downloaded opencv 2.4.5 and tried to configure in Visual studio 11. I tried compiling the below code in Debug mode by following the steps from this link. It works fine.
But the same code get crahes in release mode.
The below is the code.
#include "stdafx.h"
#include <opencv2/opencv.hpp>
using namespace cv;
int main()
{
Mat img(Mat::zeros(100, 100, CV_8U));
imshow("window", img);
waitKey();
return 0;
}
Решение
Другие советы
Try putting the OpenCV .dll files in your executable folder.
Не связан с StackOverflow