Ask Your Question

Revision history [back]

Error while installing opencv in visual studio 2012

Hi everyone, Im new to opencv and am trying to install it in visual studio 2012. Im getting the following error while building the code :

error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

The code I used is :

include "stdafx.h"

include cv.h

include highgui.h

define _CRT_SECURE_NO_WARNINGS

int main() { IplImage* img = cvLoadImage("C:/Users/Shyama Panolth/Pictures/Images/Hardeep Singh.jpg"); cvNamedWindow("MyWindow"); cvShowImage("MyWindow", img); cvWaitKey(0); cvDestroyWindow("MyWindow"); cvReleaseImage(&img); return 0; }

Please help

Error while installing opencv in visual studio 2012

Hi everyone, Im new to opencv and am trying to install it in visual studio 2012. Im getting the following error while building the code :

error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

_CRT_SECURE_NO_WARNINGS.

The code I used is :

include "stdafx.h"

include cv.h

include highgui.h

define _CRT_SECURE_NO_WARNINGS

#include "stdafx.h"
#include cv.h
#include highgui.h
#define _CRT_SECURE_NO_WARNINGS
int main()
{
          IplImage* img = cvLoadImage("C:/Users/Shyama Panolth/Pictures/Images/Hardeep Singh.jpg");
          cvNamedWindow("MyWindow");
          cvShowImage("MyWindow", img);
          cvWaitKey(0);
          cvDestroyWindow("MyWindow");
          cvReleaseImage(&img);
          return 0;
}

}

Please help