Skip to main content
gamedev.net
🔒 Locked

XML Problem

Started by Kurasu1415 Oct 14, 2008 at 11:45 AM 5 replies 1.5k views
Original Post
Kurasu1415
Kurasu1415
Hey Guys. So I am looking at using XML for a project I am working on. I want to use XML to store data for enemies and players such as their stats. I was looking at using TinyXML. Does anyone know of a good list of tutorials on getting started with it using C++? I understand the way that the XML files are setup, but I am having trouble with parsing the XML in C++. I have looked at the help documents on the Tiny XML site. In particular are there any libraries I need to add? I am simply in need of a little guidance. ~Thank you in advance
krez
krez
Did you look at the code for the sample programs that came with TinyXML? I figured out how to get it up and running from there.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Kurasu1415
Kurasu1415
I keep getting Linker Errors.
Kurasu1415
Kurasu1415
Here are the errors I get in visual c++ express.

1>------ Build started: Project: test, Configuration: Debug Win32 ------
1>Embedding manifest...
1>.\Debug\test.exe.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
1>Build log was saved at "file://c:\Programming\tinyxml_2_5_3\tinyxml\test\test\Debug\BuildLog.htm"
1>test - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Here is my code.


#include

using namespace std;

void dump_to_stdout(const char* pFilename)
{
TiXmlDocument doc(pFilename);
bool loadOkay = doc.LoadFile();
if (loadOkay)
{
printf("\n%s:\n", pFilename);
dump_to_stdout( &doc ); // defined later in the tutorial
}
else
{
printf("Failed to load file \"%s\"\n", pFilename);
}
}

int main(void)
{
dump_to_stdout("example1.xml");
return 0;
}
Zipster
Zipster
That error has nothing to do with TinyXML. You just add the TinyXML files to your project and that's it (since you have all the original source). Include tinyxml.h wherever you do XML save/load.

A cursory Google search that this error might have something to do with incorrect project settings (I didn't look too deep).
Kurasu1415
Kurasu1415
I believe you are correct. I remember the last time I tried compiling a Direct X application in Visual studio I had to change the character set to multi-byte. I am fairly sure, this is the problem. Ill post back to confirm. Thanks again,
Kurasu1415
Kurasu1415
Ok, well I solved that problem, and now I am getting this one last error. This code was copied directly from the TinyXML tutorials

error C2664: 'dump_to_stdout' : cannot convert parameter 1 from 'TiXmlDocument *' to 'const char *'

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.