[solved]LNK2019: unresolved external symbol



  • Hello,
    I want to read data from an XML file using QDomDocument and i get this error.

    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 this modules:
    #include <QCoreApplication>
    #include <QtXml/QtXml>
    #include <QDebug>
    and i also added QT += xml in my .pro file.

    Can anyone help me?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you rerun qmake after adding QT += xml ?



  • Yes and now it works!
    Thank you!


  • Lifetime Qt Champion

    You're welcome !

    Please update the thread title prepending [solved] so other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.