【发布时间】:2012-07-21 05:36:20
【问题描述】:
我在使用 RapidXML 解析字符串时遇到了一些问题。我从 Eclipse 中收到一个错误,声称解析函数不存在。
make all
Building file: ../search.cpp
Invoking: Cross G++ Compiler
g++ -DDEBUG -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"search.d" -MT"search.d" -o "search.o" "../search.cpp"
../search.cpp: In function ‘void search(CURL*, CURLcode, std::string, std::string)’:
../search.cpp:29:27: error: no matching function for call to ‘rapidxml::xml_document<>::parse(const char*)’
../search.cpp:29:27: note: candidate is:
../rapidxml-1.13/rapidxml.hpp:1381:14: note: template<int Flags> void rapidxml::xml_document::parse(Ch*) [with int Flags = Flags, Ch = char]
make: *** [search.o] Error 1
以下代码引发错误:
rapidxml::xml_document<> doc; // This has no errors
doc.parse<0>(data.c_str()); // This line raises the error (data is a string)
这里是在线文档供参考: http://rapidxml.sourceforge.net/manual.html#namespacerapidxml_1parsing
RapidXML 有四个头文件:
- rapidxml_iterators.hpp
- rapidxml_print.hpp
- rapidxml_utils.hpp
- rapidxml.hpp
如何解决我的代码中的错误,我是否首先需要以某种方式解决标头中的编译器错误?
【问题讨论】:
标签: c++ string xml-parsing rapidxml