我有一个作为 C++ Win32 应用程序创建的 DLL。为了防止在我的 DLL 中出现名称错误,我使用了下面定义的 EXPORT 定义:
#ifndef EXPORT
#define EXPORT extern "C" __declspec(dllexport)
#endif
EXPORT int _stdcall SteadyFor(double Par[], double Inlet[], double Outlet[]);
要编译此代码,我必须进入项目的属性并将 C/C++ 设置Calling Convention
为__stdcall (/Gz)并设置Compile As
为Compile as C++ Code (/TP)。
这在调试模式下工作,但发布模式正在引发error C2059: syntax error: 'string'
我所有的导出功能 - 即使我已将发布模式设置配置为与调试设置相同。
如何获得发布模式进行编译?
问候,
~Joe
(在 Visual Studio 2008 Professional 下开发)
编辑:
很多关于我的#define 的评论,这似乎没有引起任何问题。
为了消除混淆,我的头文件已被重写如下:
#ifndef coilmodel_h
#define coilmodel_h
extern "C" __declspec(dllexport) int _stdcall steadyFor(double Par[], double Inlet[], double Outlet[], char* FileIn, char* FileOut);
#endif
这就是全部。
错误是:
描述 error C2059: syntax error: 'string'
文件 coilmodel.h
行 4
同样,此错误仅出现在发布模式,而不是调试模式。
项目是一个 C++ Win32 DLL 应用程序。