title: Getting a hundred of very similar compiler errors from 'cmath' and 'cstdlib'
body: <p>I'm working on a C++ project which includes some C code as well from a third party. My build set-up is 'Desktop Qt 5.1.1 MSVC2012 64bit' which happens to be the default one when using Qt Creator on Windows, obviously.</p>
  
  <p>When trying to compile the whole thing up, I get more than a hundred compiler errors. The weird thing is that all of them seem to be very closely related, as half of them come from the C Standard Library I assume (as it says 'cstdlib' on the errors) and the other half from the C Math Library (cmath). The following is an extract of the errors I'm getting,</p>
  
  <pre><code>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdlib:19: error: C2054: expected '(' to follow 'using'
  
  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdlib:19: error: C2061: syntax error : identifier 'using'
  
  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdlib:21: error: C2059: syntax error : ';'
  
  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath:28: error: C2061: syntax error : identifier 'acosf'
  
  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath:28: error: C2059: syntax error : ';'
  </code></pre>
  
  <p>There's no need for me to copy more examples since all of them are quite like that.</p>
  
  <p>Oddly enough, I only started getting this kind of errors when I started using QMake and the MSVC2012 compiler. Before starting to add the Qt frontend, I compiled the whole thing on the latest version of g++ (MinGW), with the C++11 flag enabled (note that this flag is also enabled in the Qt .pro file).</p>
  
  <p>As I said, I wrapped a single C++ class around all the C modules I want to use. These C modules I'm talking about include the code to prevent C++ function decoration on their functions:</p>
  
  <pre><code>#ifdef __cplusplus
  extern "C" {
  #endif
  </code></pre>
  
  <p>Do you think this has to do with the compiler, with the code itself (maybe my C and my C++ are not correctly put together), the build or make configuration...?</p>
  
  <p>Any hints or thoughts are much appreciated.</p>