<p dir="auto">OpenCV 4.0.0 alpha cannot be easily included in a /clr or /clr:pure Visual Studio project, because of the new native use of <code class="notranslate">&lt;mutex&gt;</code>, which is forbidden in that case.<br>
It would be easy to fix it, using a cv::Mutex wrapper around std::recursive_mutex (instead of straight typedef), with an opaque implementation that would only include <code class="notranslate">&lt;mutex&gt;</code> in the cpp file.<br>
But would such a patch be accepted ?</p>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.4.1</li>
<li>Operating System / Platform =&gt; Windows 64 Bit</li>
<li>Compiler =&gt; Visual Studio 2017</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I can not compile quite simple OpenCV project with CLR on Visual Studio 2017. It gives me "&lt; mutex &gt; is not supported when compiling with /clr or /clr:pure." error.</p>
<h5 dir="auto">Steps to reproduce</h5>
<ul dir="auto">
<li>Start a new empty C++ project on Visual Studio 2017.</li>
<li>Try to read and show an image.</li>
<li>Go to project properties -&gt; Configuration Properties -&gt; General -&gt; Common Language Runtime Support -&gt; Select Common Language Runtime Support (/CLR)</li>
<li>Try to build.</li>
</ul>