1
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&)' 的错误

我无论如何都需要设置属性。

4

1 回答 1

3

你忘了#define TIXML_USE_STL吗?

于 2013-07-11T21:31:58.763 回答