QT中编译时出现的undefined reference to 的问题

D:\QT\qt(ui)\FaceCompartion\main.cpp:6: error: undefined reference to _imp__ZN12QApplicationC1ERiPPci' D:\QT\qt(ui)\FaceCompartion\main.cpp:10: error: undefined reference to_imp_ZN12QApplication4execEv'

QApplication::QApplication(int&, char**, int)
QApplication::exec()

没有引用 Qt 库吧

比如需要在 pro 文件中引用 gui
QT += gui

无法定义某个文件