vs2005 添加 tinyxml编译出现一堆连接错误
首先 ,我将所有的tinyxml h cpp文件加入工程,然后添加了 vs2010编译的 lib库 ! 编译运行出现如下提示:
不经常逛坛子 ,分不多 见谅 各位~
>tinyxml.obj : error LNK2005: "struct _iobuf * __cdecl TiXmlFOpen(char const *,char const *)" (?TiXmlFOpen@@YAPAU_iobuf@@PBD0@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual __thiscall TiXmlNode::~TiXmlNode(void)" (??1TiXmlNode@@UAE@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "protected: void __thiscall TiXmlNode::CopyTo(class TiXmlNode *)const " (?CopyTo@TiXmlNode@@IBEXPAV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: void __thiscall TiXmlNode::Clear(void)" (?Clear@TiXmlNode@@QAEXXZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlNode * __thiscall TiXmlNode::ReplaceChild(class TiXmlNode *,class TiXmlNode const &)" (?ReplaceChild@TiXmlNode@@QAEPAV1@PAV1@ABV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: bool __thiscall TiXmlNode::RemoveChild(class TiXmlNode *)" (?RemoveChild@TiXmlNode@@QAE_NPAV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlNode const * __thiscall TiXmlNode::FirstChild(char const *)const " (?FirstChild@TiXmlNode@@QBEPBV1@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlNode const * __thiscall TiXmlNode::LastChild(char const *)const " (?LastChild@TiXmlNode@@QBEPBV1@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlNode const * __thiscall TiXmlNode::IterateChildren(class TiXmlNode const *)const " (?IterateChildren@TiXmlNode@@QBEPBV1@PBV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlNode const * __thiscall TiXmlNode::NextSibling(char const *)const " (?NextSibling@TiXmlNode@@QBEPBV1@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlNode const * __thiscall TiXmlNode::PreviousSibling(char const *)const " (?PreviousSibling@TiXmlNode@@QBEPBV1@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlElement const * __thiscall TiXmlNode::FirstChildElement(void)const " (?FirstChildElement@TiXmlNode@@QBEPBVTiXmlElement@@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlElement const * __thiscall TiXmlNode::FirstChildElement(char const *)const " (?FirstChildElement@TiXmlNode@@QBEPBVTiXmlElement@@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlElement const * __thiscall TiXmlNode::NextSiblingElement(void)const " (?NextSiblingElement@TiXmlNode@@QBEPBVTiXmlElement@@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlElement const * __thiscall TiXmlNode::NextSiblingElement(char const *)const " (?NextSiblingElement@TiXmlNode@@QBEPBVTiXmlElement@@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlDocument const * __thiscall TiXmlNode::GetDocument(void)const " (?GetDocument@TiXmlNode@@QBEPBVTiXmlDocument@@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlElement::Accept(class TiXmlVisitor *)const " (?Accept@TiXmlElement@@UBE_NPAVTiXmlVisitor@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: char const * __thiscall TiXmlElement::GetText(void)const " (?GetText@TiXmlElement@@QBEPBDXZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: bool __thiscall TiXmlDocument::LoadFile(struct _iobuf *,enum TiXmlEncoding)" (?LoadFile@TiXmlDocument@@QAE_NPAU_iobuf@@W4TiXmlEncoding@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: bool __thiscall TiXmlDocument::SaveFile(struct _iobuf *)const " (?SaveFile@TiXmlDocument@@QBE_NPAU_iobuf@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual void __thiscall TiXmlDocument::Print(struct _iobuf *,int)const " (?Print@TiXmlDocument@@UBEXPAU_iobuf@@H@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlDocument::Accept(class TiXmlVisitor *)const " (?Accept@TiXmlDocument@@UBE_NPAVTiXmlVisitor@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlAttribute const * __thiscall TiXmlAttribute::Next(void)const " (?Next@TiXmlAttribute@@QBEPBV1@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlAttribute const * __thiscall TiXmlAttribute::Previous(void)const " (?Previous@TiXmlAttribute@@QBEPBV1@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: int __thiscall TiXmlAttribute::QueryIntValue(int *)const " (?QueryIntValue@TiXmlAttribute@@QBEHPAH@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: int __thiscall TiXmlAttribute::QueryDoubleValue(double *)const " (?QueryDoubleValue@TiXmlAttribute@@QBEHPAN@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: int __thiscall TiXmlAttribute::IntValue(void)const " (?IntValue@TiXmlAttribute@@QBEHXZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: double __thiscall TiXmlAttribute::DoubleValue(void)const " (?DoubleValue@TiXmlAttribute@@QBENXZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual void __thiscall TiXmlComment::Print(struct _iobuf *,int)const " (?Print@TiXmlComment@@UBEXPAU_iobuf@@H@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "protected: void __thiscall TiXmlComment::CopyTo(class TiXmlComment *)const " (?CopyTo@TiXmlComment@@IBEXPAV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlComment::Accept(class TiXmlVisitor *)const " (?Accept@TiXmlComment@@UBE_NPAVTiXmlVisitor@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "protected: void __thiscall TiXmlText::CopyTo(class TiXmlText *)const " (?CopyTo@TiXmlText@@IBEXPAV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlText::Accept(class TiXmlVisitor *)const " (?Accept@TiXmlText@@UBE_NPAVTiXmlVisitor@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual void __thiscall TiXmlDeclaration::Print(struct _iobuf *,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)const " (?Print@TiXmlDeclaration@@UBEXPAU_iobuf@@HPAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "protected: void __thiscall TiXmlDeclaration::CopyTo(class TiXmlDeclaration *)const " (?CopyTo@TiXmlDeclaration@@IBEXPAV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlDeclaration::Accept(class TiXmlVisitor *)const " (?Accept@TiXmlDeclaration@@UBE_NPAVTiXmlVisitor@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual void __thiscall TiXmlUnknown::Print(struct _iobuf *,int)const " (?Print@TiXmlUnknown@@UBEXPAU_iobuf@@H@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "protected: void __thiscall TiXmlUnknown::CopyTo(class TiXmlUnknown *)const " (?CopyTo@TiXmlUnknown@@IBEXPAV1@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlUnknown::Accept(class TiXmlVisitor *)const " (?Accept@TiXmlUnknown@@UBE_NPAVTiXmlVisitor@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: __thiscall TiXmlAttributeSet::~TiXmlAttributeSet(void)" (??1TiXmlAttributeSet@@QAE@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: void __thiscall TiXmlAttributeSet::Add(class TiXmlAttribute *)" (?Add@TiXmlAttributeSet@@QAEXPAVTiXmlAttribute@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: void __thiscall TiXmlAttributeSet::Remove(class TiXmlAttribute *)" (?Remove@TiXmlAttributeSet@@QAEXPAVTiXmlAttribute@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlAttribute const * __thiscall TiXmlAttributeSet::Find(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?Find@TiXmlAttributeSet@@QBEPBVTiXmlAttribute@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlAttribute const * __thiscall TiXmlAttributeSet::Find(char const *)const " (?Find@TiXmlAttributeSet@@QBEPBVTiXmlAttribute@@PBD@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl operator>>(class std::basic_istream<char,struct std::char_traits<char> > &,class TiXmlNode &)" (??5@YAAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAV01@AAVTiXmlNode@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlHandle __thiscall TiXmlHandle::FirstChild(void)const " (?FirstChild@TiXmlHandle@@QBE?AV1@XZ) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: class TiXmlHandle __thiscall TiXmlHandle::Child(int)const " (?Child@TiXmlHandle@@QBE?AV1@H@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlPrinter::VisitEnter(class TiXmlDocument const &)" (?VisitEnter@TiXmlPrinter@@UAE_NABVTiXmlDocument@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlPrinter::VisitExit(class TiXmlDocument const &)" (?VisitExit@TiXmlPrinter@@UAE_NABVTiXmlDocument@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlPrinter::VisitExit(class TiXmlElement const &)" (?VisitExit@TiXmlPrinter@@UAE_NABVTiXmlElement@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlPrinter::Visit(class TiXmlDeclaration const &)" (?Visit@TiXmlPrinter@@UAE_NABVTiXmlDeclaration@@@Z) 已经在 JSClean.obj 中定义
1>tinyxml.obj : error LNK2005: "public: virtual bool __thiscall TiXmlPrinter::Visit(class TiXmlComment const &)" (?Visit@TiXmlPrinter@@UAE_NABVTiXmlComment@@@Z) 已经在 JSClean.obj 中定义
[解决办法]
lib重复定义了。
以下文章供参考
http://cuixiang1981.blog.sohu.com/63886769.html
[解决办法]
在vc 6下编译并使用,没什么问题。2005应该也没什么问题。