Problem compiling to use

Problem compiling to use
0.0 0



I’m preparing a XMLManager to read and store data, using CCSAXParser, based on libxml2.

Basically, i follow This:

tutorial, and cocos2d-x class reference:

I create a delegate:

CCSAXDelegator * _delegate; // Delegate to set CCSAX class

I use init parsing:

First step to read a XML File
bool XMLManager::initParsing
CCSAXParser parser;
// Check if UTF-8 format
if )
return false; // Format no valid
// Set delegate
// Create var with path
const char
xmlPath = CCFileUtils::fullPathFromRelativePath(“LanguageSpanish.xml”);
// Parse Data
return true; // OK

But, compiling i get this error:

XMLManager.cpp:51: error: cannot call member function ‘const char* cocos2d::CCFileUtils::fullPathFromRelativePath(const char*)’ without object

Is some problem with last cocos2d-x stable version or i`m doing something wrong?

Thanks in advance.


Hi, problem is in how you access fileutils, API was changed.
Use this:
const char *xmlPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(“LanguageSpanish.xml”);


That solve the problem, thanks.


Well, that solve compilation problem, but i have no idea how to read info from XML.

Someone could help?

Libxml2 has no tutorials on, only some examples. This is madness, maybe is simple to use but i can not do it.


There is ccuserdefaults.cpp in cocos2d-x sources (find files around user defaults), in this file you can see how cocos work with xml.