I have been working a lot with TinyXml in the past weeks with VC2005. I have decided to move all the code of my program regarding XML into a single class named CXmlData.
Now that i have created my class with all the xml stuff i am getting an linkage errors:
XmlData.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall TiXmlDocument::StreamOut(class std::basic_ostream<char,struct std::char_traits<char> > *)const " (?StreamOut@TiXmlDocument@@MBEXPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
XmlData.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall TiXmlDocument::StreamIn(class std::basic_istream<char,struct std::char_traits<char> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?StreamIn@TiXmlDocument@@MAEXPAV?$basic_istream@DU?$char_traits@D@std@@@std@@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)
Debug/PassStore.wfx : fatal error LNK1120: 2 unresolved externals
I don't understant why it was working before with excatly the same code.
And why it complains about StreamOut/StreamIn methods?? I am not using these methods.
I have added a litle class to see if i find the problem:
Why this code gives me the same linkage errors?
--------------------------------------------------
#pragma once
#include ".\TinyXML\tinyxml.h"
I have been working a lot with TinyXml in the past weeks with VC2005. I have decided to move all the code of my program regarding XML into a single class named CXmlData.
Now that i have created my class with all the xml stuff i am getting an linkage errors:
XmlData.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall TiXmlDocument::StreamOut(class std::basic_ostream<char,struct std::char_traits<char> > *)const " (?StreamOut@TiXmlDocument@@MBEXPAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
XmlData.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall TiXmlDocument::StreamIn(class std::basic_istream<char,struct std::char_traits<char> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?StreamIn@TiXmlDocument@@MAEXPAV?$basic_istream@DU?$char_traits@D@std@@@std@@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)
Debug/PassStore.wfx : fatal error LNK1120: 2 unresolved externals
I don't understant why it was working before with excatly the same code.
And why it complains about StreamOut/StreamIn methods?? I am not using these methods.
I have added a litle class to see if i find the problem:
Why this code gives me the same linkage errors?
--------------------------------------------------
#pragma once
#include ".\TinyXML\tinyxml.h"
class CXmlData2
{
public:
CXmlData2(void);
TiXmlDocument xmlDoc;
public:
~CXmlData2(void);
};
------------------------------------------------
and this (with pointer) one doesn't?
-----------------------------------------------
#pragma once
#include ".\TinyXML\tinyxml.h"
class CXmlData2
{
public:
CXmlData2(void);
TiXmlDocument* xmlDoc;
public:
~CXmlData2(void);
};
-----------------------------------------------
I manage to solve my problem.
Somehow the TIXML_USE_STL property was not having the desired effect.
I have put the "define TIXML_USE_STL" right in the tinyxml.h before the first line "#ifdef TIXML_USE_STL" and now it works fine.