Win32动态库导出类
#ifdef PCONFIG_DLL
#else
#define PCONFIG_DLL _declspec(dllimport)
#endif
class PCONFIG_DLL InfoConfig
{
public:
int adf();
int add();
BOOL bStatus;
BOOL bDisplay;
};
就一个这样简单的代码,怎么都通不过,报错:
Struct.cpp
e:\dlltest\struct.h(11) : error C2146: syntax error : missing ';' before identifier 'bStatus'
e:\dlltest\struct.h(11) : error C2501: 'BOOL' : missing storage-class or type specifiers
e:\dlltest\struct.h(11) : error C2501: 'bStatus' : missing storage-class or type specifiers
e:\dlltest\struct.h(12) : error C2146: syntax error : missing ';' before identifier 'bDisplay'
e:\dlltest\struct.h(12) : error C2501: 'BOOL' : missing storage-class or type specifiers
e:\dlltest\struct.h(12) : error C2501: 'bDisplay' : missing storage-class or type specifiers
Error executing cl.exe.
将bStatus与bDisplay两变量屏蔽掉,程序又正常了,难道Win32动态库不能导出成员变量吗?