请给予帮助.我做了个七巧板小程序.可是在编译时,链接上有13个错误.
都是我建立的那个新类上出现链接错误.是什么原因呢?
报错的提示是这样的:
Linking...
my.obj : error LNK2005: "public: static class CObject * __stdcall CChip::CreateObject(void)" (?CreateObject@CChip@@SGPAVCObject@@XZ) already defined in Chip.obj
my.obj : error LNK2005: "protected: static struct CRuntimeClass * __stdcall CChip::_GetBaseClass(void)" (?_GetBaseClass@CChip@@KGPAUCRuntimeClass@@XZ) already defined in Chip.obj
my.obj : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CChip::GetRuntimeClass(void)const " (?GetRuntimeClass@CChip@@UBEPAUCRuntimeClass@@XZ) already defined in Chip.obj
my.obj : error LNK2005: "public: static struct CRuntimeClass const CChip::classCChip" (?classCChip@CChip@@2UCRuntimeClass@@B) already defined in Chip.obj
myDoc.obj : error LNK2005: "public: static class CObject * __stdcall CChip::CreateObject(void)" (?CreateObject@CChip@@SGPAVCObject@@XZ) already defined in Chip.obj
myDoc.obj : error LNK2005: "protected: static struct CRuntimeClass * __stdcall CChip::_GetBaseClass(void)" (?_GetBaseClass@CChip@@KGPAUCRuntimeClass@@XZ) already defined in Chip.obj
myDoc.obj : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CChip::GetRuntimeClass(void)const " (?GetRuntimeClass@CChip@@UBEPAUCRuntimeClass@@XZ) already defined in Chip.obj
myDoc.obj : error LNK2005: "public: static struct CRuntimeClass const CChip::classCChip" (?classCChip@CChip@@2UCRuntimeClass@@B) already defined in Chip.obj
myView.obj : error LNK2005: "public: static class CObject * __stdcall CChip::CreateObject(void)" (?CreateObject@CChip@@SGPAVCObject@@XZ) already defined in Chip.obj
myView.obj : error LNK2005: "protected: static struct CRuntimeClass * __stdcall CChip::_GetBaseClass(void)" (?_GetBaseClass@CChip@@KGPAUCRuntimeClass@@XZ) already defined in Chip.obj
myView.obj : error LNK2005: "public: virtual struct CRuntimeClass * __thiscall CChip::GetRuntimeClass(void)const " (?GetRuntimeClass@CChip@@UBEPAUCRuntimeClass@@XZ) already defined in Chip.obj
myView.obj : error LNK2005: "public: static struct CRuntimeClass const CChip::classCChip" (?classCChip@CChip@@2UCRuntimeClass@@B) already defined in Chip.obj
Debug/my.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
my.exe - 13 error(s), 0 warning(s)