title: ‘CvLoadImage’ was not declared in this scope
body: <p>I try to use OpenCV C Api in my code. I have <code>opencv</code> and <code>opencv2</code> folder under <code>usr/include</code>. I can use OpenCV C++ Api. C++ code and compilation&amp;linking commands are below :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "opencv2/imgproc/imgproc.hpp"
  #include "opencv2/core/core.hpp"
  #include "opencv2/opencv.hpp"
  
  using namespace cv;
  
  int main()
  {
  
      Mat im = imread("Sobel.jpg");
      return 0;
  }
  </code></pre>
  
  <p>Compile : <code>g++ -c main.cpp</code></p>
  
  <p>Linking : <code>g++ -o exe main.o</code>pkg-config --libs opencv`</p>
  
  <p>Now I want to use OpenCV C-Api. My code is here :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "opencv/cv.h"
  #include "opencv/highgui.h"
  #include "opencv2/imgproc/imgproc_c.h"
  #include "opencv2/imgproc/imgproc.hpp"
  #include "opencv2/core/core.hpp"
  #include "opencv2/opencv.hpp"
  
  using namespace cv;
  
  int main()
  {
  
      IplImage* pImg = CvLoadImage("Sobel.jpg");
      if(pImg == NULL)
           return -1;
  
      // ... big bloat to do the same operations with IplImage    
  
      CvShowImage("Image", pImg);
      cvWaitKey();
      CvReleaseImage(&amp;pImg); // Do not forget to release memory.
      // end code here
  
      return 0;
  }
  </code></pre>
  
  <p>When I compile <code>g++ -c main.cpp</code>, the compiler says that <code>‘CvLoadImage’ was not declared in this scope
  </code></p>