VC6+Qt4编译

12 篇文章 0 订阅

用VC6编译Qt4.3.4


1.下载

http://ftp.tu-chemnitz.de/pub/Qt/qt/source/qt-win-opensource-src-4.3.4.zip

2.编译

2.1.添加环境变量

我的电脑->属性->高级->环境变量->系统变量,
PATH:添加F:\Qt-4.3.4\bin
新建变量QTDIR:F:\Qt-4.3.4
新建变量QMAKESPEC:win32-msvc。

2.2.VC的环境变量

运行cmd,
%gtcd /d F:vc6\vc98\bin 进入vc6的vc98\bin中
>vcvars32.bat
>cd F:\Qt-4.3.4 进入qt主目录,
>configure
>y
>nmake
本机安装约60分钟(2.5G内存,1.81G主频)。

3.使用

#include 
#include 
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(400,300);
hello.show();
return app.exec();
}


放在F盘的hello文件夹中(工作目录可以随意选择),然后执行编译链接过程,具体如下:
F:\>hello>qmake -project //创建一个和平台无关的项目文件
F:\>hello>qmake hello.pro //根据上一步产生的项目文件创建一个平台特定的makefile
F:\>hello>qmake -tp vc hello.pro //通过hello.pro创建一个VS的项目文件
F:\>hello>nmake //编译链结程序
打开*.dsp,则在VC中可以编译,运行了;若程序经过了修改,则重新
F:\>hello>nmake //编译链结程序
那么VC中提示重新载入文件,确定,OK。


If you are using Visual Studio with Qt, you can ensure a more productive experience by adding the Qt directories to your Visual Studio list of includes.
In Visual Studio, add the following directories to the Win32 Platform Include files list (Tools|Options|Projects and Solution|VC++ Directories):
$(QTDIR)\include
$(QTDIR)\include\Qt
$(QTDIR)\include\QtCore
$(QTDIR)\include\QtGui
$(QTDIR)\include\QtHelp
$(QTDIR)\include\QtNetwork
$(QTDIR)\include\QtOpenGL
$(QTDIR)\include\QtScript
$(QTDIR)\include\QtSql
$(QTDIR)\include\QtSvg
$(QTDIR)\include\QtTest
$(QTDIR)\include\QtUiTools
$(QTDIR)\include\QtWebKit
$(QTDIR)\include\QtXml
$(QTDIR)\include\QtXmlPatterns
$(QTDIR)\src
Make sure that the QTDIR environment variable has been defined (or else manually substitute the Qt directory for $(QTDIR) in the list items).
In the VA X Options dialog, Platform should be set to Win32 (VAssistX|Visual Assist X Options|Projects|C/C++ Directories).
VA X will parse included Qt header files the next time you open a solution that uses Qt.  If you have the Stable symbols in italic option enabled, Qt symbols will be displayed in italics.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值