我正在尝试在我当前的C ++项目中使用tinyXml,在阅读了很多论坛后,我得出了以下结论:
它被称为'tiny xml'因为你不需要包含libs和dll,所有你需要做的就是在你的项目中包含'tinyxml.h / .cpp'和'tinystr.h / .cpp' ,一切都应该没问题!
....不是......
我已将这些文件放在我的项目中,当我尝试使用这些类时,我不断收到未解决的外部符号错误。
如果我做错了,请告诉我。
由于
编辑:以下是错误
Error 1 error LNK2001: unresolved external symbol "private: static struct TiXmlBase::Entity * TiXmlBase::entity" (?entity@TiXmlBase@@0PAUEntity@1@A) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 2 error LNK2019: unresolved external symbol "public: void __thiscall TiXmlDocument::SetError(int,char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?SetError@TiXmlDocument@@QAEXHPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) referenced in function "public: class TiXmlNode * __thiscall TiXmlNode::LinkEndChild(class TiXmlNode *)" (?LinkEndChild@TiXmlNode@@QAEPAV1@PAV1@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 3 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlElement::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlElement@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 4 error LNK2019: unresolved external symbol "protected: static bool __cdecl TiXmlBase::StringEqual(char const *,char const *,bool,enum TiXmlEncoding)" (?StringEqual@TiXmlBase@@KA_NPBD0_NW4TiXmlEncoding@@@Z) referenced in function "public: int __thiscall TiXmlElement::QueryBoolAttribute(char const *,bool *)const " (?QueryBoolAttribute@TiXmlElement@@QBEHPBDPA_N@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 5 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlDocument::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlDocument@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 6 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlComment::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlComment@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 7 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlText::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlText@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 8 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlDeclaration::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlDeclaration@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 9 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlUnknown::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlUnknown@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 10 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall TiXmlAttribute::Parse(char const *,class TiXmlParsingData *,enum TiXmlEncoding)" (?Parse@TiXmlAttribute@@UAEPBDPBDPAVTiXmlParsingData@@W4TiXmlEncoding@@@Z) C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\tinyxml.obj SnoMetrix
Error 11 error LNK1120: 10 unresolved externals C:\Users\Peyo\Desktop\Tradewind\Projects\SnoMetrix\Debug\SnoMetrix.exe SnoMetrix
答案 0 :(得分:4)
在最新版本中,您还必须在项目中包含/编译 tinyxmlerror.cpp 和 tinyxmlparser.cpp 。