Menu

Newby TiXmlText puzzle

pk_gsa
2005-06-17
2013-05-20
  • pk_gsa

    pk_gsa - 2005-06-17

    Hi all,
    When I execute the code below I receive an error (cannot convert parameter 1 from 'const std::string' to 'const char *') Can anyone help me remove the error?
    Thanks,
    Paul

    #include <string>

    #include <tinyxml.h>

    int main()
    {
        const std::string mystring;
        TiXmlText mytinytext( mystring );
        return 1;
    }

     
    • Lee Thomason

      Lee Thomason - 2005-06-17

      Paul --

      The std::string constructor is only available if you are using STL. (TIXML_USE_STL is defined.) In normal mode, you need to use:

      TiXmlText mytinytext( mystring.c_str() );

      lee

       
    • pk_gsa

      pk_gsa - 2005-06-17

      Thanks lee.

       

Log in to post a comment.