<p dir="auto">opencv-4.1.2 breaks vlc, e.g., since it compiles some files with gcc instead of g++<br>
Some parts of /usr/include/x86_64-pc-linux-gnu/opencv4/opencv2/core/cvdef.h<br>
can only be compiled by a C++ compiler, e.g.,<br>
#ifndef CV_CXX11</p>
<h1 dir="auto">if __cplusplus &gt;= 201103L || (defined(_MSC_VER) &amp;&amp; _MSC_VER &gt;= 1800)</h1>
<h1 dir="auto">define CV_CXX11 1</h1>
<h1 dir="auto">endif</h1>
<p dir="auto">#else</p>
<h1 dir="auto">if CV_CXX11 == 0</h1>
<h1 dir="auto">undef CV_CXX11</h1>
<h1 dir="auto">endif</h1>
<p dir="auto">#endif<br>
#ifndef CV_CXX11</p>
<h1 dir="auto">error "OpenCV 4.x+ requires enabled C++11 support"</h1>
<p dir="auto">#endif</p>
<p dir="auto">or</p>
<p dir="auto">#include </p>
<p dir="auto">Is it really intended to break packages which compile (some) files with a C-compiler?</p>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.4.1</li>
<li>Operating System / Platform =&gt; Linux</li>
<li>Compiler =&gt; gcc-7-20180222 (a 7.3.1 snapshot)</li>
</ul>

<p dir="auto">vlc-3.0.1 fails to build against  opencv-3.4.1, because the C compiler produces and error at line 485 of /usr/include/opencv2/core/cvdef.h. The error message is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="           /usr/include/opencv2/core/cvdef.h:485:1: error: unknown type name 'namespace'  "><pre class="notranslate"><code class="notranslate">           /usr/include/opencv2/core/cvdef.h:485:1: error: unknown type name 'namespace'  
</code></pre></div>
<p dir="auto">This is because the C compiler is trying to compile C++ code.</p>
<h5 dir="auto">Steps to reproduce</h5>
<ol dir="auto">
<li>build and install opencv-3.4.1</li>
<li>configure vlc-3.0.1 to include opencv and then run make</li>
</ol>
<h5 dir="auto">Proposed fix</h5>
<p dir="auto">The following patch to opencv allows the build of vlc to complete:</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--- opencv-3.4.1/modules/core/include/opencv2/core/cvdef.h.orig	2018-02-28 10:16:45.000320632 +0000
+++ opencv-3.4.1/modules/core/include/opencv2/core/cvdef.h	2018-02-28 10:34:30.852346927 +0000
@@ -454,6 +454,7 @@ Cv64suf;
 
 
 // Integer types portatibility
+#if defined __cplusplus
 #ifdef OPENCV_STDINT_HEADER
 #include OPENCV_STDINT_HEADER
 #else
@@ -494,6 +495,9 @@ typedef ::uint64_t uint64_t;
 }
 #endif
 #endif
+#else
+#include &lt;stdint.h&gt;
+#endif
 
 
 //! @}"><pre class="notranslate"><span class="pl-md">--- opencv-3.4.1/modules/core/include/opencv2/core/cvdef.h.orig	2018-02-28 10:16:45.000320632 +0000</span>
<span class="pl-mi1">+++ opencv-3.4.1/modules/core/include/opencv2/core/cvdef.h	2018-02-28 10:34:30.852346927 +0000</span>
<span class="pl-mdr">@@ -454,6 +454,7 @@</span> Cv64suf;
 
 
 // Integer types portatibility
<span class="pl-mi1"><span class="pl-mi1">+</span>#if defined __cplusplus</span>
 #ifdef OPENCV_STDINT_HEADER
 #include OPENCV_STDINT_HEADER
 #else
<span class="pl-mdr">@@ -494,6 +495,9 @@</span> typedef ::uint64_t uint64_t;
 }
 #endif
 #endif
<span class="pl-mi1"><span class="pl-mi1">+</span>#else</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#include &lt;stdint.h&gt;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#endif</span>
 
 
 //! @}</pre></div>
<p dir="auto">With the patched opencv installed, I have also built the frei0r-plugin-1.6.0, gstreamer-plugins-bad-1.12.4 and LiVES-2.8.7, all of which use opencv (although I don't know whether they failed against an unpatched version)</p>