我一直在搞乱在我的一个项目中使用RapidXML.直到我决定使用它写出xml之前,一切都进展顺利.我的代码或多或少如下:
//attempt to open the file for writing
std::ofstream file(fileName.c_str());
if (!file.is_open())
return false; //the file didn't open
xml_document<> doc;
//creates the contents of the document...
//...
//...
//write the document out to the file
file << doc; //if I remove this line it compiles...but I kinda need this line to output to the file
file.close();
Run Code Online (Sandbox Code Playgroud)
在编译时,我收到以下错误:
In file included from ../Engine/xmlfileloader.cpp:12:0:
../Engine/include/rapidxml_print.hpp: In instantiation of 'OutIt rapidxml::internal::print_node(OutIt, const rapidxml::xml_node<Ch>*, int, int) [with OutIt = std::ostream_iterator<char, char, std::char_traits<char> >; Ch …Run Code Online (Sandbox Code Playgroud)