简体   繁体   English

Qt未解析的外部符号LNK2019

[英]Qt Unresolved external symbol LNK2019

I know that this topic has been discussed, but i really can't find a solution for my problem. 我知道这个话题已经讨论过,但我真的找不到解决问题的方法。 I want to read data from an XML file with QDomDocument and i get errors of this type: 我想用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)

I included 包括我

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

and i also added Qt += xml to .pro file 我还将Qt + = xml添加到.pro文件中

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM