title: ‘_snprintf’ was not declared in this scope
body: <p>I am working on a ffmepg c++ project which links a hpp file, in the hpp file:</p>
  
  <pre><code>#define snprintf _snprintf
  #include &lt;stdio.h&gt;
  #include &lt;cstdio&gt;
  #include &lt;unistd.h&gt;
  include &lt;assert.h&gt;
  
  #if defined _MSC_VER &amp;&amp; _MSC_VER &gt;= 1200
  #pragma warning( disable: 4244 4510 4512 4610 4146 4996 4005)
  
  #define sprintf sprintf_s
  #define _sprintf _sprintf_s
  #define _snprintf _snprintf_s
  
  #endif  
  
  
  snprintf (oc-&gt;filename, sizeof(oc-&gt;filename), "%s", filename);
  </code></pre>
  
  <p>it gives the error:</p>
  
  <pre><code>‘_snprintf’ was not declared in this scope
  </code></pre>
  
  <p>It is quite weird the error shows <strong>‘_snprintf’</strong> while what I use is <strong>'snprint'</strong>. This code is wrote by others, I did not understand these <strong>#define</strong> he used. If i remove the line <strong>#define sprintf sprintf_s</strong>, it gives error:</p>
  
  <pre><code>segmentation fault(core dumped)
  </code></pre>
  
  <p>Due to ffmpeg is incompatible with C++, I have include the <strong>stdio.h</strong> and <strong>cstdio</strong> both within <strong>extern C</strong> and out of <strong>extern C</strong>, but the error continue show out. What is the problem? How to fix it?</p>