irrXML in Irrlicht 0.12 with an unresolved external symbol

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
YV

irrXML in Irrlicht 0.12 with an unresolved external symbol

Post by YV »

I attempted to add xml functionality to an irrlicht project in Irrlicht 0.12.

I got the following on this line: ... IrrXMLReader* xml = createIrrXMLReader(file.c_str()); ...

------------

NEWTON EXAMPLE error LNK2019: unresolved external symbol "class irr::io::IIrrXMLReader<char,class irr::io::IXMLBase> * __cdecl irr::io::createIrrXMLReader(char const *)" (?createIrrXMLReader@io@irr@@YAPAV?$IIrrXMLReader@DVIXMLBase@io@irr@@@12@PBD@Z) referenced in function "public: bool __thiscall Bezier::LoadXML(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?LoadXML@Bezier@@QAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

------------
when I added the default code for reading an xml file:


// create the reader using one of the factory functions
IrrXMLReader* xml = createIrrXMLReader(file.c_str());
while(xml && xml->read())
{
switch(xml->getNodeType())
{
case EXN_TEXT:
// in this xml file, the only text which // occurs is the messageText
//messageText = xml->getNodeData();
break;
case EXN_ELEMENT:
if (!strcmp("raw", xml->getNodeName()))
{
while(xml && xml->read())
{
if (!strcmp("point", xml->getNodeName()))
{
//raw.insert(
std::string s = xml->getAttributeValue("x");
float fX = (float)atof(s.c_str());
s = xml->getAttributeValue("y");
float fY = (float)atof(s.c_str());
s = xml->getAttributeValue("z");
float fZ = (float)atof(s.c_str());
vector3df v(fX,fY,fZ);
}
}
}
break;
}
}

// delete the xml parser after usage
delete xml;


I noticed that Irrlicht 0.12 uses irrXML 1.1 where the newest irrXML is 1.2.
I don't want to recompile the whole Irrlicht dll, what can I do?

Thanks!
YV

Post by YV »

IXMLReader* xml = device->getFileSystem()->createXMLReader(file.c_str());

Appears to have helped.
lagwagon
Posts: 1
Joined: Thu Jan 27, 2005 5:39 pm

Post by lagwagon »

You need to add the irrXML.cpp file to your project. Then you should be able to use
IrrXMLReader* xml = createIrrXMLReader("config.xml");
Post Reply