title: Opencv c++: error: 'it' does not name a type
body: <p>This code runs perfectly on windows but i am trying to run this on linux and it gives this error:</p>
  
  <blockquote>
    <p>In function ‘void kmline(cv::Mat, std::vector >&amp;)’:|
    error: ‘it’ does not name a type| error: expected‘;’ before ‘it’|
    error: ‘it’ was not declared in this scope| ||=== Build failed: 3
    error(s), 0</p>
    
    <blockquote>
      <p>warning(s) (0 minute(s), 3 second(s)) ===|</p>
    </blockquote>
  </blockquote>
  
  <p><strong>code:</strong></p>
  
  <pre><code>void kmline( Mat image, std::vector&lt;Point&gt;&amp; points )
  
  {.
  .
  .
  .
      if (points.size() &gt; 1) //we have 2 points
          {
  
              for (auto it = points.begin(); it != points.end(); ++it)
              {
  
  
              }
          }
  
  }
  </code></pre>