我想在Windows 7中编译此代码:(this)
#include <libxml++/libxml++.h>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(){
xmlpp::DomParser doc;
// 'response' contains your HTML
doc.parse_memory(CleanHTML(html));
xmlpp::Document* document = doc.get_document();
xmlpp::Element* root = document->get_root_node();
xmlpp::NodeSet elemns = root->find("descendant-or-self::*[@id = 'some_id']");
std::cout << elemns[0]->get_line() << std::endl;
std::cout << elemns.size() << std::endl;
return 0;
}
我使用Code :: Blocks,但它给了我错误:
undefined reference to `xmlpp::DomParser::DomParser()'
undefined reference to `Glib::ustring::ustring(std::string const&)'
undefined reference to `xmlpp::DomParser::parse_memory(Glib::ustring const&)'
undefined reference to `Glib::ustring::~ustring()'
undefined reference to `xmlpp::DomParser::get_document()'
undefined reference to `xmlpp::Document::get_root_node() const'
undefined reference to `Glib::ustring::ustring(char const*)'
undefined reference to `xmlpp::Node::find(Glib::ustring const&) const'
undefined reference to `Glib::ustring::~ustring()'
undefined reference to `xmlpp::Node::get_line() const'
undefined reference to `xmlpp::DomParser::~DomParser()'
undefined reference to `Glib::ustring::~ustring()'
undefined reference to `Glib::ustring::~ustring()'
undefined reference to `xmlpp::DomParser::~DomParser()'
所以,我认为我没有正确地链接我的图书馆;我进去了 - &gt; project-&gt;构建选项 - &gt;编译器设置 - &gt;其他选项:我添加了=&gt;
帮助this我下载了librarys =&gt; libxml2和glibmm2.4和我包括它们。
它仍然给我同样的错误!
请帮帮我。
更新17/06:我还检查了this,但它仍然给我同样的错误!
更新18/06:那就是我所做的: