试图编译 TinyXml++ tutorial使用 CodeBlocks (16.01) 和使用 VS2013,我在以下行遇到相同的错误:
ticpp::Element* pElem = doc.FirstChildElement()->NextSibling();
代码块错误:
invalid conversion from 'ticpp::Node*' to 'ticpp::Element*' [-fpermissive]
VS2013 错误:
cannot convert from 'ticpp::Node *' to 'ticpp::Element *'
有什么想法吗?
最佳答案
如果你还想编译,不管教程有没有错误,都可以使用auto关键字声明变量。
例如:
auto pElem = doc.FirstChildElement()->NextSibling();
这样,编译器将在编译时推导变量类型。
关于c++ - TinyXml++ 教程中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36997534/