What steps will reproduce the problem?
i have created a new project and added ticpp.h and practicing the example in
the wiki.
#include <iostream>
#include <conio.h>
#include "ticpp.h"
// simple function to parse a xml file
void Parse(const char* pcFilename);
using namespace std;
int main()
{
cout << "Hello world!\n" << endl;
// whatch out for exceptions
try
{
// parse the xml file with the name fruits.xml
Parse("demotest.xml");
}
catch(ticpp::Exception& ex)
{
std::cout << ex.what();
}
return -1;
}
void Parse(const char* pcFilename)
{
// first load the xml file
ticpp::Document doc(pcFilename);
doc.LoadFile();
// parse through all fruit elements
ticpp::Iterator<ticpp::Element> child;
for(child = child.begin(doc.FirstChildElement()); child != child.end(); child++)
{
// The value of this child identifies the name of this element
std::string strName;
std::string strValue;
child->GetValue(&strName);
std::cout << "fruit: " << strName << std::endl;
std::cout << "-------------" << std::endl;
// now parse through all the attributes of this fruit
ticpp::Iterator< ticpp::Attribute > attribute;
for(attribute = attribute.begin(child.Get()); attribute != attribute.end(); attribute++)
{
attribute->GetName(&strName);
attribute->GetValue(&strValue);
std::cout << strName << ": " << strValue << std::endl;
}
std::cout << std::endl;
}
}
What is the expected output? What do you see instead?
I am able to compile the file easily and this is the error messages that I am
getting.
----
1>------ Build started: Project: tinytest, Configuration: Debug Win32 ------
1>Linking...
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: class
ticpp::Element * __thiscall ticpp::Node::FirstChildElement(bool)const "
(?FirstChildElement@Node@ticpp@@QBEPAVElement@2@_N@Z) referenced in function
"void __cdecl Parse(char const *)" (?Parse@@YAXPBD@Z)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: void
__thiscall ticpp::Document::LoadFile(enum TiXmlEncoding)"
(?LoadFile@Document@ticpp@@QAEXW4TiXmlEncoding@@@Z) referenced in function
"void __cdecl Parse(char const *)" (?Parse@@YAXPBD@Z)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: __thiscall
ticpp::Document::Document(char const *)" (??0Document@ticpp@@QAE@PBD@Z)
referenced in function "void __cdecl Parse(char const *)" (?Parse@@YAXPBD@Z)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: void
__thiscall TiCppRCImp::DecRef(void)" (?DecRef@TiCppRCImp@@QAEXXZ) referenced in
function "public: virtual __thiscall ticpp::NodeImp<class
TiXmlDocument>::~NodeImp<class TiXmlDocument>(void)"
(??1?$NodeImp@VTiXmlDocument@@@ticpp@@UAE@XZ)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: __thiscall
ticpp::Exception::Exception(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(??0Exception@ticpp@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D
@2@@std@@@Z) referenced in function "public: virtual void __thiscall
ticpp::Node::IterateFirst(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
ticpp::Attribute * *)const "
(?IterateFirst@Node@ticpp@@UBEXABV?$basic_string@DU?$char_traits@D@std@@V?$alloc
ator@D@2@@std@@PAPAVAttribute@2@@Z)
1>Tinyprase.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall ticpp::Exception::~Exception(void)" (??1Exception@ticpp@@UAE@XZ)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: class
TiXmlDocument const * __thiscall TiXmlNode::GetDocument(void)const "
(?GetDocument@TiXmlNode@@QBEPBVTiXmlDocument@@XZ) referenced in function
"public: class TiXmlDocument * __thiscall TiXmlNode::GetDocument(void)"
(?GetDocument@TiXmlNode@@QAEPAVTiXmlDocument@@XZ)
1>Tinyprase.obj : error LNK2001: unresolved external symbol "public: virtual
char const * __thiscall ticpp::Exception::what(void)const "
(?what@Exception@ticpp@@UBEPBDXZ)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: bool
__thiscall TiCppRCImp::IsNull(void)" (?IsNull@TiCppRCImp@@QAE_NXZ) referenced
in function "protected: void __thiscall ticpp::Base::ValidatePointer(void)const
" (?ValidatePointer@Base@ticpp@@IBEXXZ)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: void
__thiscall TiCppRCImp::IncRef(void)" (?IncRef@TiCppRCImp@@QAEXXZ) referenced in
function "protected: virtual void __thiscall ticpp::NodeImp<class
TiXmlDocument>::operator=(class ticpp::NodeImp<class TiXmlDocument> const &)"
(??4?$NodeImp@VTiXmlDocument@@@ticpp@@MAEXABV01@@Z)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: void
__thiscall ticpp::Attribute::IterateNext(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
ticpp::Attribute * *)const "
(?IterateNext@Attribute@ticpp@@QBEXABV?$basic_string@DU?$char_traits@D@std@@V?$a
llocator@D@2@@std@@PAPAV12@@Z) referenced in function "public: class
ticpp::Iterator<class ticpp::Attribute> & __thiscall ticpp::Iterator<class
ticpp::Attribute>::operator++(void)"
(??E?$Iterator@VAttribute@ticpp@@@ticpp@@QAEAAV01@XZ)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: class
ticpp::Node * __thiscall ticpp::Node::NextSibling(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &,bool)const "
(?NextSibling@Node@ticpp@@QBEPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$a
llocator@D@2@@std@@_N@Z) referenced in function "public: void __thiscall
ticpp::Node::IterateFirst<class ticpp::Element>(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &,class ticpp::Element * *)const "
(??$IterateFirst@VElement@ticpp@@@Node@ticpp@@QBEXABV?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@PAPAVElement@1@@Z)
1>Tinyprase.obj : error LNK2019: unresolved external symbol "public: class
ticpp::Node * __thiscall ticpp::Node::FirstChild(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &,bool)const "
(?FirstChild@Node@ticpp@@QBEPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$al
locator@D@2@@std@@_N@Z) referenced in function "public: void __thiscall
ticpp::Node::IterateFirst<class ticpp::Element>(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &,class ticpp::Element * *)const "
(??$IterateFirst@VElement@ticpp@@@Node@ticpp@@QBEXABV?$basic_string@DU?$char_tra
its@D@std@@V?$allocator@D@2@@std@@PAPAVElement@1@@Z)
1>E:\docs\tinyxml\tinytest\Debug\tinytest.exe : fatal error LNK1120: 13
unresolved externals
1>Build log was saved at "file://e:\docs\tinyxml\tinytest\Debug\BuildLog.htm"
1>tinytest - 14 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
-----------
What version of the product are you using? On what operating system?
I am on VS 2008 and windows xp
Please provide any additional information below.
Original issue reported on code.google.com by vilastad...@gmail.com on 26 Aug 2012 at 8:59
Original issue reported on code.google.com by
vilastad...@gmail.com
on 26 Aug 2012 at 8:59