title: Xcode 8 (Swift): core.hpp header must be compiled as C++
body: <p>I am using the OpenCV iOS Framework in a project. I followed the necessary steps to include the framework into the project.</p>
  
  <p>The Project is written using Swift 3. </p>
  
  <p>One of my classes that contains the core functionality of the App is written in Objective-C++. I included the header of the class in my Bridge-header file but when trying to run the project I get the following error:</p>
  
  <blockquote>
    <p>error core.hpp header must be compiled as C++</p>
  </blockquote>
  
  <p>After researching online and on SO, the most common solution presented was to create a Wrapper class that would be imported in the bridge header. However, after following this <a href="https://medium.com/compileswift/ios-opencv-and-swift-1ee3e3a5735b" rel="nofollow noreferrer">article</a> I face the same problem.</p>
  
  <p>The Header file of my class looks like this:</p>
  
  <pre><code>#if TARGET_OS_IPHONE
  #import &lt;UIKit/UIKit.h&gt;
  #define IMAGE_CLASS UIImage
  #elif TARGET_OS_MAC
  #import &lt;Cocoa/Cocoa.h&gt;
  #define IMAGE_CLASS NSImage
  #endif
  
  #import &lt;AGGeometryKit/AGKQuad.h&gt;
  
  #import &lt;stdio.h&gt;
  #import &lt;opencv2/opencv.hpp&gt;
  
  #import &lt;Foundation/Foundation.h&gt;
  
  typedef void (^DebugBlock)(cv::Mat current_image, std::string current_image_name);
  
  @interface ImageScanner : NSObject
  
  /**
   *  Singleton for access to the scanner.
   *
   *  @return Shared scanner.
   */
  + (instancetype)sharedScanner;
  </code></pre>
  
  <p>Does anyone have an idea what I might be missing?</p>
  
  <p>Thank you in advance!
  G.</p>