Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks for answer, but I matched with the opencv x64 library.

C:\OpenCV\build\x64\vc10\lib

In debug mode, I put in 64bit version.

In Additional the dependencies I put this libs: c:\OpenCV\build\x64\vc10\lib\opencv_core242d.lib c:\OpenCV\build\x64\vc10\lib\opencv_highgui242d.lib c:\OpenCV\build\x64\vc10\lib\opencv_video242d.lib c:\OpenCV\build\x64\vc10\lib\opencv_ml242d.lib c:\OpenCV\build\x64\vc10\lib\opencv_legacy242d.lib c:\OpenCV\build\x64\vc10\lib\opencv_imgproc242d.lib

This is my code:

#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>

 int _tmain(int argc, _TCHAR* argv[])
    {
      // Open the file.
       IplImage *img = cvLoadImage("photo.jpg");
       if (!img) {
            printf("Error: Couldn't open the image file.\n");
            return 1;
    }

    // Display the image.
    cvNamedWindow("Image:", CV_WINDOW_AUTOSIZE);
    cvShowImage("Image:", img);

    // Wait for the user to press a key in the GUI window.
    cvWaitKey(0);

    // Free the resources.
    cvDestroyWindow("Image:");
    cvReleaseImage(&img);

    return 0;

}