Вопрос

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;
}
Это было полезно?

Решение

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

Другие советы

Try putting the OpenCV .dll files in your executable folder.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top