Pregunta

TiXmlElement * book = new TiXmlElement( "book" );  
    root->LinkEndChild( book );  
    string str1="name";
    const string str2=catalog[i].id();
    book->SetAttribute(str1,str2);

i get errors like [Error] no matching function for call to 'TiXmlElement::SetAttribute(std::string&, const string&)'

i need to set the attribute anyhow.

¿Fue útil?

Solución

Did you forget to #define TIXML_USE_STL?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top