I have a DLL that I created as a C ++ Win32 application. To prevent a name change in my DLL, I used the EXPORT definition defined below:
#ifndef EXPORT #define EXPORT extern "C" __declspec(dllexport) #endif EXPORT int _stdcall SteadyFor(double Par[], double Inlet[], double Outlet[]);
To get this code for compilation, I had to go into the Properties project and set the C / C ++ Calling Convention to __ stdcall (/ Gz) and set Compile As to Compile As C ++ Code (/ TP) .
This worked in debug mode, but Release mode throws error C2059: syntax error: 'string' to all my EXPORT functions, even if I configured the release mode settings in the same way as Debug settings.
How do I get release mode for compilation?
Respectfully,
~ Joe
(Development for Visual Studio 2008 Professional)
EDIT:
A lot of comments about my #define, which seems to cause no problems.
To eliminate the confusion, my header file was rewritten as follows:
#ifndef coilmodel_h #define coilmodel_h extern "C" __declspec(dllexport) int _stdcall steadyFor(double Par[], double Inlet[], double Outlet[], char* FileIn, char* FileOut); #endif
That's all.
Error:
Description of error C2059: syntax error: 'string'
File coilmodel.h
Line 4
Again, this error only appears in Release mode, and not in Debug mode.
A project is a C ++ Win32 DLL application.