title: Unhandled exception Microsoft C++ exception: cv::Exception at memory location
body: <p>I just started with OpenCV. I downloaded OpenCV 2.4.9, and installed MSVS 2010. My Windows is X64. I followed the following steps:</p>
  
  <p>a. Under Configuration Properties, click Debugging -> Environment and copy paste: PATH=C:\opencv\build\x86\vc10\bin</p>
  
  <p>b. VC++ Directories -> Include directories and add the entries: C:\opencv\build\include</p>
  
  <p>c. VC++ Directories -> Library directories and add the entries: C:\opencv\build\x86\vc10\lib </p>
  
  <p>d. Linker -> Input -> Additional Dependencies and add the following: </p>
  
  <blockquote>
    <p>opencv_calib3d249.lib;opencv_contrib249.lib;opencv_core249.lib;opencv_features2d249.lib;opencv_flann249.lib;opencv_gpu249.lib;opencv_nonfree249.lib;opencv_highgui249.lib;opencv_imgproc249.lib;opencv_legacy249.lib;opencv_ml249.lib;opencv_objdetect249.lib;opencv_ts249.lib;opencv_video249.lib;</p>
  </blockquote>
  
  <p>I ran the following code: </p>
  
  <pre><code>#include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  int main() {
          // read an image
          cv::Mat image= cv::imread("img.jpg");
          // create image window named "My Image"
          cv::namedWindow("My Image");
           cv::waitKey(1000);
          // show the image on window
          cv::imshow("My Image", image);
          // wait key for 5000 ms
          cv::waitKey(50);
          return 1;
  }
  </code></pre>
  
  <p>To get the error:</p>
  
  <blockquote>
    <p>Unhandled exception at 0x76d2b727 in BTP1.exe: Microsoft C++ exception: cv::Exception at memory location 0x003af414</p>
  </blockquote>
  
  <p>I figured this might be because of the X64 and x86 mismatch. On changing the entries in a. to PATH=C:\opencv\build\ <strong>x64</strong> \vc10\bin and in c. to C:\opencv\build\ <strong>x64</strong> \vc10\lib, I get the following error:</p>
  
  <blockquote>
    <p>The application was unable to start correctly (0xc000007b). Click OK to close the application.</p>
  </blockquote>
  
  <p>Any tips on how I can get over this issue?</p>