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; }
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
Thanks lee.
Log in to post a comment.
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;
}
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
Thanks lee.