完整报错如下:
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `main':
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:5: undefined reference to `__imp__ZN12QApplicationC1ERiPPci'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:6: undefined reference to `__imp__ZN11QPushButtonC1ERK7QStringP7QWidget'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:8: undefined reference to `__imp__ZN7QWidget4showEv'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:9: undefined reference to `__imp__ZN12QApplication4execEv'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:6: undefined reference to `__imp__ZN11QPushButtonD1Ev'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:5: undefined reference to `__imp__ZN12QApplicationD1Ev'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:6: undefined reference to `__imp__ZN11QPushButtonD1Ev'
C:/Users/Guangsheng Li/Desktop/untitled/main.cpp:5: undefined reference to `__imp__ZN12QApplicationD1Ev'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `QString::QString(char const*)':
C:/ProgramData/Anaconda3/Library/include/qt/QtCore/qstring.h:659: undefined reference to `__imp__ZN7QString16fromAscii_helperEPKci'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `QWidget::resize(int, int)':
C:/ProgramData/Anaconda3/Library/include/qt/QtWidgets/qwidget.h:838: undefined reference to `__imp__ZN7QWidget6resizeERK5QSize'
CMakeFiles\untitled.dir/objects.a(main.cpp.obj): In function `QTypedArrayData<unsigned short>::deallocate(QArrayData*)':
C:/ProgramData/Anaconda3/Library/include/qt/QtCore/qarraydata.h:237: undefined reference to `__imp__ZN10QArrayData10deallocateEPS_yy'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\untitled.dir\build.make:125: untitled.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:96: CMakeFiles/untitled.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:103: CMakeFiles/untitled.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:137: untitled] Error 2