最近我正在使用Qt/C++/xml和其他一些東西進行項目。我必須從XML文件中獲取一些字符串值。爲此,我正在使用Qt未定義引用`pugi :: xml_document :: xml_document()`
#include "pugixml.hpp"
。
但是,當我使用pugi::xml_document document;
,它給出了一個錯誤如下。
undefined reference to 'pugi::xml_document::xml_document()'
正如我在this link看到我不得不使用pugixml.cpp
而編制。任何人都知道如何將pugixml.cpp
添加到Qt項目中?
我使用,
Qt Creator 4.0.2 Based on Qt 5.7.0 (GCC 4.9.1 20140922(Red Hat 4.9.1-10), 63 bit)
由於您使用的是Qt,因此它提供了許多使用XML的類,請參閱http://doc.qt.io/qt-5/xml-processing.html,爲什麼要使用第三方圖書館? – ManuelH
@ManuelH我認爲Qt的xml實現比其他xml實現稍微笨拙一些。 – voidpointercast