hi... i want to ask how to run this tinyxml...
i tried tutorial at tinyxml tutorial... but i got error message and i don't know why...
here's the code...
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");
getchar();
return 0;
}
and the error (at dump_to_stdout( &doc ); // defined later in the tutorial) is :
cannot convert `TiXmlDocument*' to `const char*' for argument `1' to `void dump_to_stdout(const char*)'
is there anything wrong? (beside my bad english... :D)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You must define dump_to_stdout(TiXmlDocument*) before calling it in your file. Or define it in another place(include file examplecode.h where it already defined)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi... i want to ask how to run this tinyxml...
i tried tutorial at tinyxml tutorial... but i got error message and i don't know why...
here's the code...
#include "tinyxml.h"
#include "tinystr.h"
#include "tinyxmlerror.cpp"
#include "tinyxml.cpp"
#include "tinyxmlparser.cpp"
#include "tinystr.cpp"
#include <stdio.h>
#include <stdlib.h>
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");
getchar();
return 0;
}
and the error (at dump_to_stdout( &doc ); // defined later in the tutorial) is :
cannot convert `TiXmlDocument*' to `const char*' for argument `1' to `void dump_to_stdout(const char*)'
is there anything wrong? (beside my bad english... :D)
You must define dump_to_stdout(TiXmlDocument*) before calling it in your file. Or define it in another place(include file examplecode.h where it already defined)