QT的第一次编译

以前一直在使用BCB,主要是基于borland的感情,但是目前的情况看,我得项目不能再跟着borland走了。由于GUI涉及的内容还是不少的,因此转换的过程需要谨慎。经过1个月的评比,参考了很多人的使用感受之后,最终选择了QT,而不是wx。


我先下GPL版本的QT开始学习,安装过程还是狠简单的,中间安装了minGW。然后按照教程里面的Hello Word章节写了一个例子。由于QT没有提供IDE环境,对于习惯于windows下面开发的我还是有一点点不适应。不过倒霉事在后头:(


使用命令
qmake -project
qmake
可以生成3个目录,一个debug,一个release和一个tmp目录,还有3个makefile文件和一个工程文件(.pro)。剩下的make就得借助别的编译器来完成了。开始的时候使用BCB的make,但是提示什么FORCE之类的问题。使用-t vcapp参数生成VC的dsp文件,在VC下面编译,也还是不行。既然本身带了minGW,为什么不用自己的mingw32-make试试呢。最终终于完成了make。不过由于minGW和QT不是安装在一个目录的,为了方便起见,写了个批处理文件:


@ECHO OFF
set QTDIR=E:\Leejd\qt4
set PATH=E:\Leejd\qt4\bin;E:\Leejd\MinGW\bin;%SystemRoot%\System32;%path%
set QMAKESPEC=win32-g++


if exist release del release\*.* /q
qmake -project
qmake
mingw32-make


只要把这个批处理文件扔到你的例子目录下,双击执行就OK!

This entry was posted in BCB||C++. Bookmark the permalink.

5 Responses to QT的第一次编译

  1. lancey says:

    我感觉没有必要写这些东西,现在的qt安装后直接从程序目录里面打开Command Prompt就可以很好的编译了。

  2. SA says:

    内容不够细

  3. SA says:

    内容不够细

  4. ilinux says:

    LZ安装软件时候不够细心,没看INSTALL or README文档。

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word