Qt未解析的外部符号LNK2019

时间:2013-09-15 17:14:12

标签: c++ qt

我知道这个话题已经讨论过,但我真的无法找到解决问题的方法。我想用QDomDocument读取XML文件中的数据,我得到这种类型的错误:

main.obj:-1: error: LNK2019: unresolved external symbol “__declspec(dllimport) public: class QDomElement __cdecl QDomNode::toElement(void)const “ (__imp_?toElement@QDomNode@@QEBA?AVQDomElement@@XZ) referenced in function “void __cdecl ListElements(class QDomElement,class QString,class QString)” (?ListElements@@YAXVQDomElement@@VQString@@1@Z)

我包括

#include <QCoreApplication>
#include <QtXml/QtXml>
#include <QDebug>

我还将Qt + = xml添加到.pro文件

1 个答案:

答案 0 :(得分:9)

在将模块添加到.pro文件后,您需要运行qmake (这将重新生成带有正确库的makefile,然后链接器将找到这些库)

相关问题