Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error building sample application Qt 5.14, Visual stuido 2019



  • Hello all,
    I am trying to build my project on visual studio using msvc2017- 64 bit compiler getting the following errors:
    error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z)error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z)error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z)
    : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z): error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z): error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z)
    : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z): error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z): error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z)
    error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z) error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z) error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl QMetaObject::connectSlotsByName(class QObject *)" (_imp?connectSlotsByName@QMetaObject@@SAXPEAVQObject@@@Z)
    error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ) error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ) error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)
    error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)
    : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)
    j : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)j : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)j : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)
    : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QMetaObject::Connection::~Connection(void)" (_imp??1Connection@QMetaObject@@QEAA@XZ)
    rror LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)rror LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)rror LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)
    error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)
    : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)
    : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ): error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)
    error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ) error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ) error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString __cdecl QObject::objectName(void)const " (_imp?objectName@QObject@@QEBA?AVQString@@XZ)


  • Lifetime Qt Champion

    You don't link against QtCore.



  • @Christian-Ehrlicher : can u please explain in detail.
    The compiler is not giving any error have included all the header files. :)


  • Lifetime Qt Champion

    @Kira said in Error building sample application Qt 5.14, Visual stuido 2019:

    can u please explain in detail.

    What should I explain here? If you want to use QtCore, you have to link against it. If you're using pro-files than this is done automatically. If you're using something else you have to do it on your own.



  • @Christian-Ehrlicher : Actually when i was using msvc2015 along with visual studio everything was working fine. So i have followed the same process here for msvc 2017


  • Lifetime Qt Champion

    @Kira said in Error building sample application Qt 5.14, Visual stuido 2019:

    So i have followed the same process here for msvc 2017

    Which process? What buildsystem do you use? What Qt version do you use, ... ? It would be really nice when you can provide the information without we need to ask every time - you're here long enough to know what we need.



  • @Christian-Ehrlicher said in Error building sample application Qt 5.14, Visual stuido 2019:

    here long enough to know what we need.

    Sorry for that.
    Here are the details of the implementation:
    I am using Qt 5.14 and using the msvc-2017 compiler.
    Below are the snaps of the settings:

    2895e77b-7e8c-4134-8798-8b002c9c73a4-image.png in case of anything else required.
    80028b12-b0cc-4e0b-86d7-50f5808f6ac2-image.png

    General settings:
    of c/C++
    b53e5084-3596-496c-a091-21538105e7cc-image.png


Log in to reply