Solved link problems
-
I retired a little over a year ago and have not used Qt since leaving the work place. I installed QT and mingw 5.3 and tried to compile a simple program. I am pasting the link commands and the first few error messages where the link step failed:
g++ -Wl,-subsystem,windows -mthreads -o debug\Singles_party.exe debug/begin_party.o debug/party_room.o debug/moc_party_room.o -lmingw32 -LC:\Qt\5.7\mingw53_32\lib C:\Qt\5.7\mingw53_32\lib\libqtmaind.a -LC:\utils\postgresql\pgsql\lib -LC:\utils\my_sql\my_sql\lib -lshell32 C:\Qt\5.7\mingw53_32\lib\libQt5Guid.a C:\Qt\5.7\mingw53_32\lib\libQt5Cored.a
debug/begin_party.o: In functionZ5qMainiPPc': C:\Users\bigdad\Paul\QT\Programs\Singles_party/begin_party.cpp:6: undefined reference to
_imp___ZN12QApplicationC1ERiPPci'
C:\Users\bigdad\Paul\QT\Programs\Singles_party/begin_party.cpp:8: undefined reference to_imp___ZN7QWidget4showEv' C:\Users\bigdad\Paul\QT\Programs\Singles_party/begin_party.cpp:9: undefined reference to
_imp___ZN12QApplication4execEv'Can someone tell me what I need to do here?
-
Hi and welcome to devnet,
Any chance of missing
QT += widgets
in your .pro file ? -
The mingw you installed.
Was that from the Qt online installer? -
No, from sourceforge
-
@pdnorman
Ok that could be the issue.
If possible could u remove Qt and install with
http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-windows-x86-mingw530-5.7.0.exe
Its 99% of the time a happy just works out of the box. -
same thing happens
-
@pdnorman
Ok ?!
Also with a default GUI project via File->New Qt widget application ? -
Hi and welcome to devnet,
Any chance of missing
QT += widgets
in your .pro file ? -
I DID need the QT += widgets in the .pro file. Thanks