问题:vector< 自定义类> 结果自定义类的构造函数在连接时发生LNK2005错误,望指点迷津。
有两个类myclass和myclass1:classmyclassclassmyclass1{{}vector<myclass>v;}运行提示errorLNK2005:"...
有两个类myclass和myclass1:
class myclass class myclass1
{ {
} vector<myclass> v;
}
运行提示error LNK2005: "public: __thiscall myclass::myclass(void)" (??0myclass@@QAE@XZ) already defined in myclass.obj
error LNK2005: "public: virtual __thiscall ChildOfAttr::~ChildOfAttr(void)" (??1ChildOfAttr@@UAE@XZ) already defined in ChildOfAttr.obj
fatal error LNK1169: one or more multiply defined symbols found
求好心人不吝赐教,谢谢! 展开
class myclass class myclass1
{ {
} vector<myclass> v;
}
运行提示error LNK2005: "public: __thiscall myclass::myclass(void)" (??0myclass@@QAE@XZ) already defined in myclass.obj
error LNK2005: "public: virtual __thiscall ChildOfAttr::~ChildOfAttr(void)" (??1ChildOfAttr@@UAE@XZ) already defined in ChildOfAttr.obj
fatal error LNK1169: one or more multiply defined symbols found
求好心人不吝赐教,谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询