qt4.3.2编译vs2005下编译过程(自己学习下)

在vs2005中使用qt4.3.2

首先在vs2005中加入头文件,库文件的查找路径:
tools->options->projects and solutions->vc++ directories->include files加入c:\qt\4.3.2\include
在library中加入c:\qt\4.3.2\lib

完成上述工作后:我们着手建立一个空的makefile project
new->project ->general->makefile project
进入工程属性页 property pages

First you create a new Makefile Project in a empty solution. Then go to the project Property Pages (right click project-〉Properties). Make sure that Debug is the current Configuration and choose "NMake" in the left menu. Then open the Window for "Build command Line" by clicking the "..." Button. Here you enter:

%QTDIR%\bin\qmake
nmake debug
In "Rebuild Command Line" you enter:

%QTDIR%\bin\qmake
nmake debug-clean
nmake debug
And in "Clean Command Line":

%QTDIR%\bin\qmake
nmake debug-clean
Now the last change, in "Output" enter:

debug\[you app Name].exe
Now do the same thing for release Configuration, but substitute "debug" with "release" ( also in Output Path!)

Now confirm this dialog with OK and create a new File. To do so right click your project and choose Add->Add new Files. Here choose "Text File (.txt)" and as name enter "src.pro", or something similar. In this file enter:

TEMPLATE = app
CONFIG += qt [do you config here, mine would be: "qt warn_on"]
QT += [do you qt-config here]
SOURCES = main.cpp
HEADERS =
TARGET = [your App Name]

win32:debug:CONFIG += console [->if you want to receive qDebug() messages on Windows...]
Save this file and add another file to your project: main.cpp, do it as you did it with the pro File, but choose "C++ File (.cpp)" as file type.

If you want to add another source file to your project, just add it with the add menu, and don't forget to add the files to the right section in your pro-File. This pro file can be used like any normal pro-File, without any problems.

按以上步骤操作后
随便做一个测试:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton *button = new QPushButton("Quit");
QObject::connect(button, SIGNAL(clicked()),
&app, SLOT(quit()));
button->show();
return app.exec();
}

ok!!!



1.下载qt-win-commercial-src-4.3.1.zip
http://qt.tttxp.ru/4.3.1/qt-win-commercial-src-4.3.1.zip

2.下载qt-vsintegration-1.3.1.exe
http://qt.tttxp.ru/4.3.1/qt-vsintegration-1.3.1.exe
(注册码:
LicenseID="4444"
Licensee="StarDancer"
LicenseKeyExt=FGKX-RM5-F4M-2CX-3P5X-HGM8X-2B52


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值