QT4+MinGW+Code::Blocks IDE集成

qtplatforms13map再转载一篇关于安装和在中使用的文章,含有详细的步骤。关于的介绍:

is a cross-platform application and framework. Using , you can write applications once and deploy them across many desktop and operating systems without rewriting the source code. Develop applications and user interfaces once, and deploy them across Windows, Mac, Linux/X11, Linux, Windows CE and S60 (coming soon) without rewriting the source code.  - qtsoftware.com

以下为具体转载内容。

1、下载安装Code::Blocks8.02
http://downloads.sourceforge.net/codeblocks/codeblocks-8.02mingw-setup.exe
这个版本包含了。我的安装路径为E:\Develops\CodeBlocks,安装路径为E:\Develops\CodeBlocks\
2、下载安装QT4,http://trolltech.com/developer/downloads/qt/windows,我选了-win-opensource-4.4.2-.exe,现版本为4.4.2,我的安装目录为E:\Develops\QT4\4.4.2。在安装时有选项提示帮助安装所需的,直接选择Code::Blocks下的就可以了。我安装时选择了下载,花了很长时间,而且安装衙以现缺少gdb.exe,不能Debug。
3、设置环境变量:
QTDIR=E:\Develops\QT4\4.4.2
INCLUDE=E:\Develops\QT4\4.4.2\include;E:\Develops\CodeBlocks\\include
LIB=E:\Develops\QT4\4.4.2\lib;E:\Develops\CodeBlocks\\lib
PATH中加入E:\Develops\QT4\4.4.2\bin;E:\Develops\CodeBlocks\\bin
如果安装了VC等其它编译器,那么必须删除INCLUDE、LIB中相应项,保证环境变量的干净。
4、执行程序菜单中的"QT4 Build Debug Libraries",产生debug库。时间很长,而且环境变量设置有问题的话,就会在几小时后显示失败。
5、打开CodeBlocks,菜单tools -> Configure tools,单击Add添加2个工具菜单项。
1) -project
    执行程序为\bin下的.exe,参数为 " -project",工作目录设为“${PROJECT_DIR}".
设置你喜欢的launching Options.
2)
  同上,除开参数为空。
6、新建一QT4工程,步骤如下:
1)其它可默认,在最后将Output dir直接设为"Debug\"和"Release\"。因为新建工程的Debug和Release目录直接产生在工作目录下,没有默认的"bin\Debug"目录,这时选择菜单上"Build->Run"将会找不到执行目标。
2)选择project->properties,选中"This is a custom Makefile".
3)依次选择tools->" -project"及,产生Makefile
4)Build->Build
5)Build->Run,成功!
6)按以上操作,Debug也能成功,并且能使用 Designer生成
这样配置就完成了!
只是Build菜单中的ReBuild、Clean、Rebuild Workspace等功能目前都不能使用,也算是个小遗憾。

来源:http://www.qtcn.org/bbs/read.php?tid=13022

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Slashdot
  • Technorati
  • TwitThis

Related posts:

  1. Setting up Code::Blocks to work with SDL - 多媒体编程库
  2. Code::Blocks + Qt体验
  3. Code::Blocks IDE: 手动安装和配置编译器指南
  4. Debugging with Code::Blocks
  5. Code::Blocks IDE in openSUSE 11.1编译和安装指南
  6. 如何在Windows上安装Code Blocks 8.02官方发布版
  7. Code::Blocks Debug Shortcut and Example
  8. 加法?减法:CodeLite or Code::Blocks just for another sourceinsight
  9. Code::Blocks编译skyeye步骤
  10. ProjectManager, Project and ProjectFile in Code::Blocks

Leave a Reply

 

 

 

You can use these HTML tags

<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

Contact us

Admin: Bryan Wu