very stupid question...

Developer
2009-04-14
2013-05-20
  • Roy Margasa

    Roy Margasa - 2009-04-14

    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 \&quot;%s\&quot;\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)

     
    • Pavel Shuvalov

      Pavel Shuvalov - 2009-04-14

      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)

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks