Linker Error in Qt v5.6
-
Hi, I am student of Electrical Engineering. I am new to programming frameworks, I decided to use QT for GUI development of my end-semester programming project. But problem I am getting an error about linking which is given below:
How can I resolve this issue?
-
It looks like you created a console application and trying to add widgets to it.
Since you're using a widget (push button) you need to useQApplicationinstead ofQCoreApplication. There are basically 3 subclasses:
QCoreApplicationis for apps wthout ui (e.g. console apps)
QGuiApplicationis for non-widget based ui apps (e.g. using QWindow or QML)
QApplicationis for widget based apps, like yours.To use widgets make sure you have that module enabled. You will also need gui module. Open your .pro file and make sure these modules are enabled like this:
QT += core gui widgets
Ifguiorwidgetsis missing add it and clickBuild->Run qmake. After that your project should build. -
Thanks for solution!!!