title: extern "C" DLL: Debug is OK, Release throws Error C2059
body: <p>I've got a DLL that I've created as a C++ Win32 application. To prevent name mangling in my DLL, I have used the EXPORT definition defined below:</p>
  
  <pre><code>#ifndef EXPORT
  #define EXPORT extern "C" __declspec(dllexport)
  #endif
  
  EXPORT int _stdcall SteadyFor(double Par[], double Inlet[], double Outlet[]);
  </code></pre>
  
  <p>To get this code to compile, I had to go into the project's Properties and set the C/C++ <code>Calling Convention</code> to <b>__stdcall (/Gz)</b> and set <code>Compile As</code> to <b>Compile as C++ Code (/TP)</b>.</p>
  
  <p>This worked in Debug mode, but Release mode is throwing <code>error C2059: syntax error: 'string'</code> on all of my EXPORT functions - even though I have configured the Release mode settings to be the same as the Debug settings.</p>
  
  <p>How do I get Release Mode to compile?</p>
  
  <p>Regards,<br>
  ~Joe<br>
  (Developing under Visual Studio 2008 Professional)</p>
  
  <p><b>EDIT:</b><br>
  A lot of comments about my #define, which does not appear to be causing any problems.</p>
  
  <p>To eliminate the confusion, my header file has been rewritten as follows:</p>
  
  <pre><code>#ifndef coilmodel_h
  #define coilmodel_h
  
  extern "C" __declspec(dllexport) int _stdcall steadyFor(double Par[], double Inlet[], double Outlet[], char* FileIn, char* FileOut);
  
  #endif
  </code></pre>
  
  <p>That is all of it.</p>
  
  <p>The error is:<br>
  <b>Description</b> <code>error C2059: syntax error: 'string'</code><br>
  <b>File</b> <code>coilmodel.h</code><br>
  <b>Line</b> <code>4</code></p>
  
  <p>Again, this error only appears in Release mode, not Debug mode.<br>
  Project is a C++ Win32 DLL application.</p>