TiXmlElement * book = new TiXmlElement( "book" );
root->LinkEndChild( book );
string str1="name";
const string str2=catalog[i].id();
book->SetAttribute(str1,str2);
我收到类似 [Error] no matching function for call to 'TiXmlElement::SetAttribute(std::string&, const string&)' 的错误
我无论如何都需要设置属性。