title: cvblob compile error in Visual C++ 6.0
body: <p>I'm using Microsoft Visual C++ 6.0 and Microsoft Visual Studio 2008 to develop an academic computer vision project. </p>
  
  <p>In this project i need to use OpenCV 1.1 (http://opencv.willowgarage.com/) and CvBlob (http://code.google.com/p/cvblob/). </p>
  
  <p>I tried to compile this project with Microsoft Visual Studio 2008 and it compiles without errors. </p>
  
  <p>With Visual C++ 6.0 i got a lot of errors. </p>
  
  <p>OpenCV are not responsible of this behavior, because a trivial project with only OpenCV (without CvBlob) works well.  </p>
  
  <p>To understand the errors better I made an empty project with only the CvBlob inclusion. </p>
  
  <p>I paste here a brief summary of the errors:</p>
  
  <pre><code>cvcontour.cpp(253) : error C2371: 'i' : redefinition; different basic types (and others similar to this. i solved with variable redefinition, every time)
  
  cvcontour.cpp(318) : error C2664: 'thiscall std::vector&lt;struct CvPoint,class std::allocator&lt;struct CvPoint&gt; &gt;::std::vector&lt;struct CvPoint,class std::allocator&lt;struct CvPoint&gt; &gt;(unsigned int,const struct CvPoint &amp;,const class std::allocator&lt;struct CvPoint&gt; &amp;)' : cannot convert parameter 1 from 'class std::deque&lt;struct CvPoint,class std::allocator&lt;struct CvPoint&gt; &gt;::iterator' to 'unsigned int' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
  
  cvtrack.cpp(278) : error C2440: 'initializing' : cannot convert from 'struct cvb::CvTrack *const ' to 'struct cvb::CvBlob *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
  </code></pre>
  
  <p>Have you ideas on how can i solve these problems? </p>
  
  <p>Thanks in advance for the help!</p>
  
  <p><strong>-------- UPDATE --------</strong></p>
  
  <p>I tried to edit and correct the code in order to elminate the three errors in my question. </p>
  
  <p>The error C2664 seems to be the more difficult to cirmumvent... </p>
  
  <p>I have replaced the indicted line </p>
  
  <pre><code>return new CvContourPolygon(dq.begin(), dq.end());
  </code></pre>
  
  <p>where CvContourPolygon is a <code>typedef std::vector&lt;CvPoint&gt; CvContourPolygon;</code></p>
  
  <p>with </p>
  
  <pre><code>deque&lt;int&gt;::iterator dq_it;dq_it = dq.begin();
  CvContourPolygon v_tmp;
  v_tmp.push_back(*dq_it);
  while (dq_it != dq.end()){
    v_tmp.push_back(*dq_it++);
  }
  </code></pre>
  
  <p>First, what that i wrote is correct? Than, how can i solve the errors that occured from this?</p>
  
  <p>Thank you in advance!</p>
  
  <p>Errors (suppose that the first line is 318: </p>
  
  <pre><code>cvcontour.cpp(319) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class std::deque&lt;struct CvPoint,class std::allocator&lt;struct CvPoint&gt; &gt;::iterator' (or 
  there is no acceptable conversion)
  cvcontour.cpp(321) : error C2664: 'push_back' : cannot convert parameter 1 from 'int' to 'const struct CvPoint &amp;'
      Reason: cannot convert from 'int' to 'const struct CvPoint'
      No constructor could take the source type, or constructor overload resolution was ambiguous
  cvcontour.cpp(322) : error C2679: binary '!=' : no operator defined which takes a right-hand operand of type 'class std::deque&lt;struct CvPoint,class std::allocator&lt;struct CvPoint&gt; &gt;::iterator' (or there is no acceptable conversion)
  cvcontour.cpp(322) : fatal error C1903: unable to recover from previous error(s); stopping compilation
  </code></pre>
  
  <p>Error executing cl.exe.</p>
  
  <p><strong>-------- UPDATE2 --------</strong></p>
  
  <p>This code seems to work correctly!</p>
  
  <pre><code>deque&lt;CvPoint&gt;::iterator dq_it;
  dq_it = dq.begin();
  CvContourPolygon v_tmp;
  for (dq_it = dq.begin(); dq_it != dq.end(); ++dq_it){
    v_tmp.push_back(*dq_it);
  }
  //return new CvContourPolygon(dq.begin(), dq.end());
  return &amp;v_tmp;
  </code></pre>