title: 'cvFindContours' was not declared in this scope, opencv 2.4.2, compilation error
body: <p>I am working on detecting edges and finding quadrilateral shapes on image using opencv 2.4.2 libraries. Everthing was going smooth, until I got these compilation errors </p>
  
  <pre><code>../src/GoodFeaturesToDetect.cpp:198:109: error: ‘cvFindContours’ was not declared in this scope
  ../src/GoodFeaturesToDetect.cpp:203:106: error: ‘cvContourPerimeter’ was not declared in this scope
  ../src/GoodFeaturesToDetect.cpp:203:114: error: ‘cvApproxPoly’ was not declared in this scope
  ../src/GoodFeaturesToDetect.cpp:206:64: error: ‘cvContourArea’ was not declared in this scope
  </code></pre>
  
  <p>Here are my headers:</p>
  
  <pre><code>#include &lt;opencv2/core/core.hpp&gt;
  #include "opencv2/imgproc/imgproc.hpp"
  #include "opencv2/highgui/highgui.hpp"
  #include &lt;stdlib.h&gt;
  #include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace cv;
  using namespace std;
  
  void DrawLine( Mat img, Point start, Point end );
  vector&lt;Point2f&gt; FindCornersUsingGoodFeaturesToTrack(Mat toTrack);
  void ConnectPointsWithLine(Mat img,vector&lt;Point2f&gt; corners);
  void DrawQuad(Mat img, Point a, Point b, Point c, Point d);
  void DetectAndDrawQuads(Mat img);
  </code></pre>
  
  <p>Here is the method that calls the function(s)</p>
  
  <pre><code>void DetectAndDrawQuads(Mat img){
          CvSeq* contours;
          CvSeq* result;
          CvMemStorage *storage=cvCreateMemStorage(0);
          Mat gray;
          cvtColor(img,gray,CV_BGR2GRAY);
          cvFindContours(&amp;gray,storage, &amp;contours, sizeof(CvContour),CV_RETR_LIST,CV_CHAIN_APPROX_SIMPLE, Point(0,0));
  
          //Loop through all the contours discovered
          //Figure out which ones form a quad
          while(contours){
              result=cvApproxPoly(contours, sizeof(CvContour),storage, CV_POLY_APPROX_DP,cvContourPerimeter(contours)*0.02,0);
  
          if(result-&gt;total=4 &amp;&amp; fabs(cvContourArea(result, CV_WHOLE_SEQ)) &gt; 20){
              CvPoint *pt[4];
              for(int i=0; i&lt;4; i++)
                  pt[i]=(CvPoint*) cvGetSeqElem(result,i);
  
              DrawQuad(gray,*pt[0],*pt[1],*pt[2],*pt[3]); 
  
          }
          contours = contours-&gt;h_next;
          }
  
  }
  </code></pre>
  
  <p>DetectAndDrawQuads gets called from main()..</p>
  
  <p>Here are the linked libraries</p>
  
  <pre><code>opencv_contrib opencv_flann opencv_legacy opencv_calib3d opencv_ml opencv_imgproc opencv_highgui opencv_objdetect opencv_core opencv_features2d
  </code></pre>
  
  <p>I am working on Eclipse CDT (Helois)</p>
  
  <p>I would appreciate any hint. Thanks.</p>