title: openCV 2.4.3 iOS framework compiler trouble recognising some c++ headers
body: <p>openCV 2.4.3 / Xcode 4.5.2  / mac osx 10.8.2 </p>
  
  <p>I am trying to get openCV working with iOS. I am attempting to use the the prebuilt 2.4.3 framework from openCV.org.  However I am getting the following xcode project build errors that suggest the compiler doesn't know it is dealing with c++, eg</p>
  
  <pre><code>#include &lt;list&gt;       !'list' file not found
  
  namespace cv          !unknown type name 'namespace'
  </code></pre>
  
  <p>This only seems to concern the following header files:<br>
  "opencv2/nonfree/features2d.hpp"<br>
  "opencv2/nonfree/nonfree.hpp"<br>
  "opencv2/video/video.hpp"  </p>
  
  <p>if I don't include these three files in opencv.hpp (or anywhere else) I seem to be able to compile and use openCV ok. The trouble is, I do need the nonfree files as I am experimenting with SURF - which has been moved to nonfree recently. </p>
  
  <p>This is really a twofold question (sorry ;-)</p>
  
  <ul>
  <li>how do I convince the compiler that these are c++ headers?  </li>
  <li>which headers exactly do I need to use SURF?</li>
  </ul>
  
  <p><strong>update</strong></p>
  
  <p>I have cloned the openCV git repository and built a new framework from that. This approach had not worked previously, but today I realised that I was not using the current version of CMAKE. I had been using CMAKE 2.8.2 and this would fail to build opencv for ios. Current version CMAKE 2.8.10 builds it without any issues (that's an object lesson in obeying the docs, which do say CMAKE min. v2.8.8 is required). </p>
  
  <p>Now when I add this current build of the opencv framework in an Xcode project I can include <em>features2d</em> and <em>nonfree</em> and build smoothly. The only problem remains with one header: <code>video/background_segm.hpp</code>, which still yields:</p>
  
  <pre><code>#include &lt;list&gt;       !'list' file not found
  </code></pre>
  
  <p>If I comment <em>that</em> line out I get an error on the next line:</p>
  
  <pre><code>namespace cv          !unknown type name 'namespace'
  </code></pre>
  
  <p>It seems clear that the compiler doesn't recognise this as a C++ header, even though it is suffixed <code>.hpp</code>.</p>
  
  <p>In <code>opencv2/video/video.hpp</code>  if I remove </p>
  
  <pre><code>#include "opencv2/video/background_segm.hpp"
  </code></pre>
  
  <p>I can build with <code>video.hpp</code> also (although I guess it would be unusable in practice).</p>
  
  <p>Unfortunately I still can't get SURF to work. When I run the project it crashes with this error:  </p>
  
  <blockquote>
    <p>OpenCV Error: The function/feature is not implemented (OpenCV was built without SURF support)  </p>
  </blockquote>
  
  <p>This is triggered in <code>legacy/features2d.cpp</code>:  </p>
  
  <pre><code>   Ptr&lt;Feature2D&gt; surf = Algorithm::create&lt;Feature2D&gt;("Feature2D.SURF");
     if( surf.empty() )
          CV_Error(CV_StsNotImplemented, "OpenCV was built without SURF support");
  </code></pre>
  
  <p>The questions remain...</p>
  
  <ul>
  <li>how do I convince the compiler that <code>background_segm.hpp</code> is a legit c++ header?  </li>
  <li>how do I enable SURF support?</li>
  </ul>