m1.h:
#pragma once
#ifdef DLL_EXPORTS
#define SIMPLE_CLASS_EXPORT __declspec(dllexport)
#else
#define SIMPLE_CLASS_EXPORT __declspec(dllimport)
#endif
m1Example.h:
class SIMPLE_CLASS_EXPORT M1Example:public CObject
{
public:
M1Example();//构造函数
~M1Example();//析构函数
}
编译出现错误:error LNK2019: 无法解析的外部符号 "__declspec(dllimport) const M1Example::`vftable'" (__imp_??_7M1Example@@6B@),该符号在函数 "public: __thiscall M1Example::M1Example(void)" (??0M1Example@@QAE@XZ) 中被引用。