I wrote a simple test program for opencv to see if it's working after I compiled my OpenCV 2.4 in visual studio 2010 pro.
The program goes like this:
#include "StdAfx.h"
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
Mat im = imread("c:/full/path/to/lena.jpg");
if (im.empty())
{
cout << "Cannot load image!" << endl;
return -1;
}
imshow("Image", im);
waitKey(0);
}
The thing is that the program compiles without problems ( I've set all the lib paths and include paths in visual studio), but when I try to run it, it gives me the following error message winow: "The program can't start because opencv_core240d.dll is missing from your computer. Try reinstalling the program to fix this problem"
Now, I've read that this could be solved by setting the windows PATH variable to the directory where the actual .dll file is located by doing a cmd command:
SET PATH="C:\Program Files (x86)\OpenCV\opencv\build\bin\Debug"
The path specified is indeed the path where the .dll file is located however, I still get the error.
Help would really be appreciated since I've spent far too much time cocking around this...