For some reason, this code produces an access violation at the second imread, but not the first.
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main(int argc, char **argv)
{
Mat mat1, mat2;
char imgname1[255]="cise_StackD.tif";
mat1 = imread( imgname1, CV_LOAD_IMAGE_GRAYSCALE);
char imgname2[255]="ecise_StackD.tif";
mat2 = imread( imgname2, CV_LOAD_IMAGE_GRAYSCALE);
return 0;
}
The exact runtime error message is: "Unhandled exception at 0x61f437ef (msvcr100d.dll) in MLMVNroThrust.exe: 0xC0000005: Access violation reading location 0xcccccccc." The identical code with identical visible project settings runs acceptably on another PC. The images are identical copies.
I'm using OpenCV 2.4.3 prebuilt binaries; the projects are set up to use CUDA as well, but I have stripped out all CUDA code in order to isolate the problem.
What makes this Access Violation and how do I get rid of it?
Thanks.