Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Unresolved external symbol LNK2019

Tags:

c++

qt

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

like image 636
laura Avatar asked Sep 15 '13 17:09

laura


1 Answers

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)

like image 78
Zlatomir Avatar answered Oct 10 '22 05:10

Zlatomir