<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 and Linux Debian 7  64 Bit</li>
<li>Compiler =&gt; Visual Studio 2015 and GCC 4.9.3</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto"><strong>Problems with C API in OpenCV 3.4.1.</strong><br>
Any OpenCV 3.x.x and OpenCV 2.x.x works fine, except for OpenCV 3.4.1</p>
<p dir="auto">When I include <code class="notranslate">opencv2/core/core_c.h</code> file in any C-file <code class="notranslate">source.c</code> and try to compile with OpenCV 3.4.1 - I get errors:</p>
<ul dir="auto">
<li>Windows 7x64 MSVS2015:</li>
</ul>
<blockquote>
<p dir="auto">C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cstdint(18): error C2054: expected '(' to follow 'using'</p>
</blockquote>
<ul dir="auto">
<li>Linux Debian 7 x64 GCC 4.9.3:</li>
</ul>
<blockquote>
<p dir="auto">/usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name ‘namespace’</p>
</blockquote>
<h5 dir="auto">Steps to reproduce</h5>
<div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// C code example
#include &quot;opencv2/core/core_c.h&quot;
int main() {
  return 0;
}"><pre class="notranslate"><span class="pl-c">// C code example</span>
<span class="pl-k">#include</span> <span class="pl-s">"opencv2/core/core_c.h"</span>
<span class="pl-smi">int</span> <span class="pl-en">main</span>() {
  <span class="pl-k">return</span> <span class="pl-c1">0</span>;
}</pre></div>
<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>