title: opencv-3.0.0 ubuntu 14.04 "nonfree/nonfree.hpp" build error
body: <p>I am trying to implement the SURF algorithm in opencv-3.0.0
  For it I have included the header files</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include "opencv2/core.hpp"
  #include "opencv2/features2d.hpp"
  #include "opencv2/highgui.hpp"
  #include "opencv2/calib3d.hpp"
  #include "opencv2/xfeatures2d.hpp"
  #include "opencv2/calib3d.hpp"
  #include &lt;opencv2/nonfree/nonfree.hpp&gt;
  using namespace cv;
  using namespace std;
  </code></pre>
  
  <p>but I keep getting the error mentioned below. I have tried searching everywhere but couldn't find any solution. I have already build the opencv module with extra dependencies.</p>
  
  <pre><code>In file included from /usr/include/opencv2/nonfree/nonfree.hpp:46:0,
               from panaroma.cpp:7:
  /usr/include/opencv2/nonfree/features2d.hpp:73:21: error: ‘vector’ has not been declared
                   vector&lt;KeyPoint&gt;&amp; keypoints) const;
                   ^
  /usr/include/opencv2/nonfree/features2d.hpp:73:27: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
                   vector&lt;KeyPoint&gt;&amp; keypoints) const;
                         ^
  /usr/include/opencv2/nonfree/features2d.hpp:77:21: error: ‘vector’ has not been declared
                   vector&lt;KeyPoint&gt;&amp; keypoints,
                   ^
  /usr/include/opencv2/nonfree/features2d.hpp:77:27: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
                   vector&lt;KeyPoint&gt;&amp; keypoints,
                         ^
  /usr/include/opencv2/nonfree/features2d.hpp:76:10: error: ‘void cv::SIFT::operator()(cv::InputArray, cv::InputArray, int) const’ cannot be overloaded
   void operator()(InputArray img, InputArray mask,
        ^
  /usr/include/opencv2/nonfree/features2d.hpp:72:10: error: with ‘void cv::SIFT::operator()(cv::InputArray, cv::InputArray, int) const’
   void operator()(InputArray img, InputArray mask,
        ^
  /usr/include/opencv2/nonfree/features2d.hpp:81:5: error: ‘AlgorithmInfo’ does not name a type
   AlgorithmInfo* info() const;
   ^
  /usr/include/opencv2/nonfree/features2d.hpp:83:49: error: ‘vector’ has not been declared
   void buildGaussianPyramid( const Mat&amp; base, vector&lt;Mat&gt;&amp; pyr, int nOctaves ) const;
                                               ^
  /usr/include/opencv2/nonfree/features2d.hpp:83:55: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void buildGaussianPyramid( const Mat&amp; base, vector&lt;Mat&gt;&amp; pyr, int nOctaves ) const;
                                                     ^
  /usr/include/opencv2/nonfree/features2d.hpp:84:33: error: ‘vector’ does not name a type
   void buildDoGPyramid( const vector&lt;Mat&gt;&amp; pyr, vector&lt;Mat&gt;&amp; dogpyr ) const;
                               ^
  /usr/include/opencv2/nonfree/features2d.hpp:84:39: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void buildDoGPyramid( const vector&lt;Mat&gt;&amp; pyr, vector&lt;Mat&gt;&amp; dogpyr ) const;
                                     ^
  /usr/include/opencv2/nonfree/features2d.hpp:85:39: error: ‘vector’ does not name a type
   void findScaleSpaceExtrema( const vector&lt;Mat&gt;&amp; gauss_pyr, const vector&lt;Mat&gt;&amp; dog_pyr,
                                     ^
  /usr/include/opencv2/nonfree/features2d.hpp:85:45: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void findScaleSpaceExtrema( const vector&lt;Mat&gt;&amp; gauss_pyr, const vector&lt;Mat&gt;&amp; dog_pyr,
                                           ^
  /usr/include/opencv2/nonfree/features2d.hpp:89:40: error: ‘vector’ has not been declared
   void detectImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, const Mat&amp; mask=Mat() ) const;
                                      ^
  /usr/include/opencv2/nonfree/features2d.hpp:89:46: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void detectImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, const Mat&amp; mask=Mat() ) const;
                                            ^
  /usr/include/opencv2/nonfree/features2d.hpp:90:41: error: ‘vector’ has not been declared
   void computeImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, Mat&amp; descriptors ) const;
                                       ^
  /usr/include/opencv2/nonfree/features2d.hpp:90:47: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void computeImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, Mat&amp; descriptors ) const;
                                             ^
  /usr/include/opencv2/nonfree/features2d.hpp:125:28: error: ‘vector’ has not been declared
                   CV_OUT vector&lt;KeyPoint&gt;&amp; keypoints) const;
                          ^
  /usr/include/opencv2/nonfree/features2d.hpp:125:34: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
                   CV_OUT vector&lt;KeyPoint&gt;&amp; keypoints) const;
                                ^
  In file included from /usr/include/opencv2/nonfree/nonfree.hpp:46:0,
               from panaroma.cpp:7:
  /usr/include/opencv2/nonfree/features2d.hpp:128:28: error: ‘vector’ has not been declared
                   CV_OUT vector&lt;KeyPoint&gt;&amp; keypoints,
                          ^
  /usr/include/opencv2/nonfree/features2d.hpp:128:34: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
                   CV_OUT vector&lt;KeyPoint&gt;&amp; keypoints,
                                ^
   /usr/include/opencv2/nonfree/features2d.hpp:127:10: error: ‘void cv::SURF::operator()(cv::InputArray, cv::InputArray, int) const’ cannot be overloaded
   void operator()(InputArray img, InputArray mask,
        ^
   In file included from /usr/include/opencv2/nonfree/nonfree.hpp:46:0,
               from panaroma.cpp:7:
  /usr/include/opencv2/nonfree/features2d.hpp:124:10: error: with ‘void cv::SURF::operator()(cv::InputArray, cv::InputArray, int) const’
   void operator()(InputArray img, InputArray mask,
        ^
  In file included from /usr/include/opencv2/nonfree/nonfree.hpp:46:0,
               from panaroma.cpp:7:
  /usr/include/opencv2/nonfree/features2d.hpp:132:5: error: ‘AlgorithmInfo’ does not name a type
   AlgorithmInfo* info() const;
   ^
  /usr/include/opencv2/nonfree/features2d.hpp:142:40: error: ‘vector’ has not been declared
   void detectImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, const Mat&amp; mask=Mat() ) const;
                                      ^
  /usr/include/opencv2/nonfree/features2d.hpp:142:46: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void detectImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, const Mat&amp; mask=Mat() ) const;
                                            ^
  /usr/include/opencv2/nonfree/features2d.hpp:143:41: error: ‘vector’ has not been declared
   void computeImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, Mat&amp; descriptors ) const;
                                       ^
  /usr/include/opencv2/nonfree/features2d.hpp:143:47: error: expected ‘,’ or ‘...’ before ‘&lt;’ token
   void computeImpl( const Mat&amp; image, vector&lt;KeyPoint&gt;&amp; keypoints, Mat&amp; descriptors ) const;
                                             ^
  </code></pre>
  
  <p><strong>EDIT 1</strong>
  So, the issue I was actually facing was that I was trying to use the package which was in development and not stable version. I just had to do <code>git checkout 3.0.0</code> to get to the stable version.</p>