title: Add C++ code to C project
body: <p><em>What I want to do:</em></p>
  
  <p>I have autogenerated C Code generated with Matlab Simulink and want to enhance it with some more functionality written in C++. To be exact, the C code calls a C-style API that internally uses C++. The whole thing is in a VS 2008 C++ project. </p>
  
  <p><em>The problem:</em></p>
  
  <p>It compiles, as long as I tell VS to compile it as C and leave out my C++ code. As soon as I compile it as C++ problems arise.</p>
  
  <p>First of all, I can't compile it as C++ because math.h produces an error C2668 due to an ambiguous call to an overloaded function (fabs()).</p>
  
  <p>If I now additionally add some C++, e.g. include iostream, I get hundreds of compiler errors complaining about missing curly braces and misplaced colons somewhere in cstdlib.</p>
  
  <p><em>My question:</em></p>
  
  <p>How can I mix the two languages in a way that works? I read about preprocessor defines (<a href="http://www.parashift.com/c++-faq-lite/overview-mixing-langs.html" rel="nofollow">http://www.parashift.com/c++-faq-lite/overview-mixing-langs.html</a>) but I don't know how to apply them correctly to solve my problem.</p>
  
  <p>Any help is greatly appreciated!</p>