Reputation: 2135
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:
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
Upvotes: 5
Views: 8697
Reputation: 7034
You need to run qmake after you add modules into the .pro file (that will regenerate the makefile with the correct libraries added and then the linker will find those)
Upvotes: 11