Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot run Opencv with C++ syntax
    text
    copied!<ul> <li>Im using Opencv 2.3.1 on Visual studio 2010 (vc10)</li> <li>I have configured opencv based on many tutorials and can compile &amp; run C-syntax program like:</li> </ul> <p><code></p> <pre><code>#include "StdAfx.h" #include &lt;iostream&gt; #include &lt;opencv2/opencv.hpp&gt; using namespace std; using namespace cv; int main () { IplImage* img = cvLoadImage("D:\cat_helmet.jpg", CV_LOAD_IMAGE_UNCHANGED); cvNamedWindow("display", CV_WINDOW_AUTOSIZE); cvShowImage("display", img ); cvWaitKey(0); return 0; } </code></pre> <p></code></p> <p>However, I cannot run the C++ syntax program like <code></p> <pre><code>#include "StdAfx.h" #include &lt;opencv2/core/core.hpp&gt; #include &lt;opencv2/highgui/highgui.hpp&gt; #include &lt;iostream&gt; using namespace cv; using namespace std; int main( ) { namedWindow( "Display window", CV_WINDOW_AUTOSIZE ); Mat image; image = imread("D:\cat_helmet", CV_LOAD_IMAGE_COLOR); if(! image.data ) { cout &lt;&lt; "Could not open or find the image" &lt;&lt; std::endl ; return -1; } imshow( "Display window", image ); waitKey(0); return 0; } </code></pre> <p></code></p> <p>I got the error messages (in the function calls: <strong>namedWindow</strong>, <strong>imread</strong>, <strong>imshow</strong>)</p> <p><code> First-chance exception at 0x5361fcc3 in FirstOpencv2.3.exe: 0xC0000005: Access violation reading location 0x2079616c. </code></p> <p><code> Unhandled exception at 0x5361fcc3 in FirstOpencv2.3.exe: 0xC0000005: Access violation reading location 0x2079616c. </code></p> <p>How can I fix this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload