m1.h文件:
#pragma once
#ifdef DLL_EXPORTS
#define SIMPLE_CLASS_EXPORT __declspec(dllexport)
#else
#define SIMPLE_CLASS_EXPORT __declspec(dllimport)
#endif
m1Example.h文件:
#include "m1.h"
class SIMPLE_CLASS_EXPORT M1Example:public CObject//声明导入导出才可以使用别人的东西和被别人使用
{
public:
M1Example();//构造函数
~M1Example();//析构函数
};
编译不通过,出现:error LNK2019: 无法解析的外部符号 "__declspec(dllimport) const M1Example::`vftable'" (__imp_??_7M1Example@@6B@)