-----------------------------------------------------
QT下面,第一个程序的运行过程:
1、把如下的程序拷贝到文件“hello.cpp”中:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
2、将文件“hello.cpp”保存在目录“D:\Qt\test\1\hello”下(根据实际情况选择目录)
3、选择“Qt 4.1.4 Command Prompt”,进入命令行界面,进入刚才保存“hello.cpp”的目录(主要用DOC命令:cd D:\Qt\test\hello )
4、在命令提示符后面,分别输入:
qmake -project
(to create a platform-independent project file (hello.pro))
qmake hello.pro
(to create a platform-specific makefile from the project file)
make
(to build the program)
5、经过以上三个步骤以后,在“hello.cpp”所在的目录下,得到以下一系列文件:
6、在这个目录下面的“release”文件夹下面,得到一个windows下面的可执行程序“hello.exe”:
注意:
要新建一个文件夹:hello。
其他的配置方法与文章中一致。
