各位前辈好! 我是Qt初学者,遇到一些问题,所以上来请教一下:
windows xp + qt-windows-opensource-5.0.1-mingw47_32-x86-offline.exe
源代码:
#include <QCoreApplication>#include <QPushButton>int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); QPushButton pushButton(QObject::tr("Hello Qt!")); pushButton.show(); QObject::connect(&pushButton,SIGNAL((clicked()),&a,SLOT(quit()); return a.exec(); }
保存为 HelloQt.cpp 后,使用cmd 开始编译:
qmake -project //OK qmake HelloQt.pro//OK mingw32-make.exe > mingw32-make.exe -f Makefile.Release mingw32-make.exe[1]: Entering directory 'E:/QtCode/HelloQt'g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT _OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I. -I"." -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtGui" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I"release" -I"D:\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspec s\win32-g++" -o release\main.o main.cppmain.cpp:2:23: **fatal error: QPushButton: No such file or directory** compilation terminated. Makefile.Release:175: recipe for target 'release/main.o' failed mingw32-make.exe[1]: *** [release/main.o] Error 1mingw32-make.exe[1]: Leaving directory 'E:/QtCode/HelloQt'makefile:34: recipe for target 'release' failed mingw32-make.exe: *** [release] Error 2
求教各位前辈~
饮歌长啸
相关分类