[Solved] createXMLWriter = crash?

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
lpersona
Posts: 58
Joined: Fri Jul 18, 2008 8:03 am
Location: low
Contact:

[Solved] createXMLWriter = crash?

Post by lpersona »

whenever Irrlicht's XMLWriter is called to create a new file on my pc (openSUSE 11.3) with following lines...

Code: Select all

	IFileSystem* sys;
	IXMLWriter* xml_re = sys->createXMLWriter("config.xml");

it leads to following errors

../src/xmlwriter.cpp:18:36: error: ‘fopen’ was not declared in this scope
../src/xmlwriter.cpp:26:60: error: ‘fprintf’ was not declared in this scope
../src/xmlwriter.cpp:33:18: error: ‘fclose’ was not declared in this scope
../src/xmlwriter.cpp:40:17: error: ‘fprintf’ was not declared in this scope
../src/xmlwriter.cpp:63:17: error: ‘fprintf’ was not declared in this scope
../src/xmlwriter.cpp:77:20: error: ‘fprintf’ was not declared in this scope
../src/xmlwriter.cpp:89:17: error: ‘fprintf’ was not declared in this scope
../src/xmlwriter.cpp:118:17: error: ‘fprintf’ was not declared in this scope



which i initially traced back to a missing header in xmlWriter.cpp?

however, while including

Code: Select all

#include <cstdio>
does avoid these error messages, my program simply crashes at the very moment said .xml file is supposed to be created.


i'm sorry to ask but..why is createXMLWriter not working?
does anyone else have this problem?
is there a solution? :(
Last edited by lpersona on Sun Jan 16, 2011 3:22 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What kind of file is ../src/xmlWriter.cpp? Does not look like an Irrlicht one?! The Irrlicht XML writer is definitely working. Do you use a 64bit OS? There are some problems with files generated on those systems. Crashing when opening the file is not a known error, though. Sounds more like you have a broken compilation somehow.
Arcoroc
Posts: 51
Joined: Wed Oct 01, 2008 11:40 pm
Location: Canada

Post by Arcoroc »

Don't you need to refer to the file system in a similar fashion to this:

Code: Select all

// ... assuming device is a valid pointer.
 irr::io::IXMLWriter* xwriter = device->getFileSystem()->createXMLWriter( "file.xml" );
L/
lpersona
Posts: 58
Joined: Fri Jul 18, 2008 8:03 am
Location: low
Contact:

Post by lpersona »

indeed. xmlwriter.cpp is a 3rd party xml parser i was playing around with earlier and forgot to remove it from my project.
it has no influence, though. pure irrlicht crashes as before. whereas Sudi's recommendation (3rd post) works perfectly.

32bit is how my system operates.


edit: i'll try this getFileSystem now...
edit: works :shock:

thanks a lot you 2 (and expecially Arcoroc for the final solution)
Post Reply