Access Violation by reading msvcr120d.dll VC12

asked 2015-02-03 13:40:23 -0500

Kinimod gravatar image

updated 2015-02-03 13:44:56 -0500

Hello guys,

I'm using Visual Studio 2013. I have a x64 Windows 7 with Visual Studio 2013 -> VC12 and OPENCV 2410. I've done the following steps for another x64 System with VC12 and OPENCV 2410, but Windows 8.1. The code works fine on the last named machine.

But I get a access violation error by reading msvcr120d.dll on the first one.

I have hardcoded the path to the library and include folder for testing. Also the path to the image. So opencv is set in C:\opencv

Set the configs to:

Added user variable with name "OPENCV_DIR" and path "C:\opencv\build\x86\vc12"

Added the bin-path to system's path environment variable: %OPENCV_DIR%\bin

Compiler -> General -> Additional libraries: C:\opencv\build\include

Linker -> General -> Additional libraries: C:\opencv\build\x86\vc12\lib

Linker -> Input :

opencv_core2410d.lib opencv_imgproc2410d.lib opencv_highgui2410d.lib opencv_ml2410d.lib opencv_video2410d.lib opencv_features2d2410d.lib opencv_calib3d2410d.lib opencv_objdetect2410d.lib opencv_contrib2410d.lib opencv_legacy2410d.lib opencv_flann2410d.lib

This is my test code:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main(int argc, char** argv)
{    
    String path = "Capture.PNG";
        Mat image = imread(path, IMREAD_COLOR); // Read the file

    waitKey(0); // Wait for a keystroke in the window
    return 0;
}
edit retag flag offensive close merge delete

Comments

Hey Guys,

Here is the answer :) I've identified the cause.

Properties Pages -> General -> Character Set was not set to anything. I changed it to Unicode and now it works fine.

Kinimod gravatar imageKinimod ( 2015-02-04 15:01:49 -0500 )edit