c++xmltinyxml

TinyXml Unresolved External issues


I'm trying to use tinyXml in my current C++ project, and after reading many forums I've come to the following conclusion:

it's called 'tiny xml' because you don't need to inlcude libs and dlls, all you need to do is include the 'tinyxml.h/.cpp' and the 'tinystr.h/.cpp' in your project, and everything should be fine!

....It's not...

I've put those files in my project, and I keep getting the unresolved external symbol errors when I try to use the classes.

Please tell me if I'm doing something wrong.

Thanks

EDIT: Here are the errors

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

Solution

  • In the latest versions, you also have to include/compile tinyxmlerror.cpp and tinyxmlparser.cpp in your project.