Irrlicht XML Error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

Irrlicht XML Error

Post by Guest »

I'm attempting to use the built in XML reading within Irrlicht 0.12 to load a configuration XML to setup how the device will be created. Yet I am having the compiler return an error that I'm not sure what exactly to do with. . . It's stating that there is an unresolved symbol within the XMLReader class method; yet I have linked the libs an' done everything that I can think that I should have to do for it to be working correctly. If someone with a spare moment or three on their hands could please lend some assistiance I would be very greatful. Thank you :)
Compiling...
CFramework.cpp
Linking...
CFramework.obj : 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 CFramework::Init(void)" (?Init@CFramework@@QAE_NXZ)
./irrGame_DEBUG.exe : fatal error LNK1120: 1 unresolved externals

Build log was saved at "file://****\Debug\BuildLog.htm"
irrGame - 2 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped


Code: Select all

class CFramework
{
private:
	irr::io::IrrXMLReader* m_hConfig;
public:
	CFramework() {};
	~CFramework() {};

	bool Init();
	void Release();
};

//---

bool CFramework::Init()
{
	CLogger::writeLog("CFramework::Init() <Begin>");
	m_hConfig = irr::io::createIrrXMLReader("./datas/config.xml");
	if(!m_hConfig)
	{
		CLogger::writeLog("CFramework::Init() <Failed>: Could not read configuration file.");
		return false;
	}
	m_hConfig->drop();
	CLogger::writeLog("CFramework::Init() <Success>");
	return true;
}
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Use irr::io::IFileSystem::createXMLReaderUTF8 instead.
Guest

Post by Guest »

Warchief, thank you for the suggestion. But when attempting this through the method you suggested, the compiler returns an error of irr::io::IFileSystem::createXMLReaderUTF8 not being a static method; an' with thus I am unable to use it.

I know that creating the XML reader after the device has been created by means of pDevice->getFileSystem()->createXMLReaderUTF8("./datas/config.xml"); works, but if I attempt to read the XML this way my application will crash. I am having to guess it does this as the device isn't created at this point, since I have no paramaters to pass to it from the XML configuration file yet.

Is there anything else that I may be missing here that stops me from reading the XML file before the device is created?
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Indeed i meant it to be used with device->getFileSys

You then may try TinyXML. Dunno if is it posible to use irrXML without device create. I use Ini files to config device and then xml files to config game.

Sry i cant help more.
Guest

Post by Guest »

Okies, thankies for the help once again Warchief. Is anyone else able to confirm what Warchief is saying about not being able to use irrXML without first creating the device; if there is a way could someone please point me in the right direction? Thank you in advance, regardless of how the answer turns to be.
hiker
Posts: 58
Joined: Thu May 31, 2007 5:12 am

Post by hiker »

Hi,

I just had an answer for a quite similar problem: 'dances' suggested to create a device with the 'EDT_NULL' device, use this to access the files, before deleting it and creating the 'real' device you need.

Hope that help you, too!

Cheers,
Joerg
pauly
Posts: 10
Joined: Wed Mar 23, 2005 11:29 am
Location: Belgium
Contact:

I 've got the same message

Post by pauly »

I 've gotten the same message and fixed it by adding the irrXML.cpp to the project :p under source files. Kinda obvious if you think about it. I didn't, found it by accident :)
Post Reply