<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; :4.0.1</li>
<li>Operating System / Platform =&gt; :10.13.6</li>
<li>Compiler =&gt; Xcode 10.0 GNU++ 11</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I want to inherit an openCV class <strong><em>CvVideoCamera</em></strong> in my Swift project. Here is what I did:</p>
<ol dir="auto">
<li>Create a Objective-C wrapper</li>
<li>Create a bridging file to import the header of the wrapper</li>
<li>In the header of my Objective-C wrapper</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#import &lt;opencv2/videoio/cap_ios.h&gt;

@interface VideoCameraImpl: CvVideoCamera
"><pre class="notranslate"><code class="notranslate">#import &lt;opencv2/videoio/cap_ios.h&gt;

@interface VideoCameraImpl: CvVideoCamera

</code></pre></div>
<p dir="auto">Then I got the following error message:</p>
<blockquote>
<blockquote>
<p dir="auto">opencv2.framework/Headers/core.hpp:49:4: Core.hpp header must be compiled as C++</p>
</blockquote>
</blockquote>
<p dir="auto">I know it's possible to moving the import to .mm file is able to fix the issue. But I can't do that because I need to inherit a class from OpenCV and make it public so that I can use it in my Swift project. Is there a way to do this? Thanks.</p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Operating System / Platform =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
<li>Compiler =&gt; <g-emoji class="g-emoji" alias="grey_question" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2754.png">❔</g-emoji></li>
</ul>
<h5 dir="auto">Detailed description</h5>

<h5 dir="auto">Steps to reproduce</h5>