以下的代碼,開頭的前三行代碼都報錯,而且報錯信息同樣:
QApplication file not foundcode
#include<QApplication> #include<QDialog> #include<QLabel> int main(int argc,char *argv[]) { QApplication a(argc,argv); QDialog w; QLabel label(&w); label.setText("Hello World!你好 Qt!"); w.show(); return a.exec(); }
頭文件改爲:get
#include<QtWidgets/QApplication> #include<QtWidgets/QDialog> #include<QtWidgets/QLabel>