Could you please explain how to use tinyxml2 in windows? I tried to add CC_DLL to class declaration which uses tinyxml, but I still got linkage errors.
Here is an example of what I am doing how it helps (please excuse the response layout not good at getting the layout right). One thing that I need to double check is the release of memory. Also when you do this you need to add the CC_DLL in your class declaration.
class CC_DLL YOUR_CLASS{
}
std::string _engineSetup = cocos2d::CCFileUtils::sharedFileUtils()>fullPathForFilename;
tinyxml2::XMLDocument* xmlDoc = new tinyxml2::XMLDocument;
unsigned long nSize;
const char* pXmlBuffer = cocos2d::CCFileUtils::sharedFileUtils>getFileData, “rb”, &nSize);
if {
CCLOG ("---------------- can not read xml file %d", nSize);
CCAssert;
}
xmlDoc~~>Parse;
tinyxml2::XMLElement* element = xmlDoc~~>FirstChildElement( “ROOTELEMENT” );
CCAssert(element != NULL, “Cannot find ROOTELEMENT root Node”);
I have chosen not to use the tinyxml2 that is provided and just included my own in my project. I already have too many classes and am not about to change them. Overall it works fine and I am happy with the end result.