Qt笔记(5)重新搭建Qt开发环境 一

刚开始的时候图省事,直接下载了1.3G的 Qt SDK 完整开发环境下来安装,结果就出问题了:学习开发自定义控件时安装不上,提示:The plugin' 'uses incompatible Qt library.Expected build key"windows msve release full-config",got"windows mingw debug"

关于这个错误,官方说:
The version of QT Creator shipped with the QT SDK Open Source version for windows is build using Visual Studio, whereas the SDK is build with and supports g++ (MinGW). This doesn’t cause too many problems, but it totally defeats building and installing QT Designer plugins into QT Creator. The error message is:

也就是说,QtCreator是用Visual Studio编译的,但QtCreator的编译器是MinGW,编译出来的控件自然就加载不到QtCreator上了。

网上说解决方法有三种:

1) Build QT Creator from source with MinGW
2) Build the plugin with Visual Studio
3) Build QT Creator with build key checking turned off.

我就选择了第一种:自己编译安装QtCreator。

1、下载

MinGW-gcc440_1.zip

qt-win-opensource-4.8.2-mingw.exe

 

如果不需要下载完整的 SDK,仅下载 Qt 框架的源软件包即可。你可以在安装过程中选择LGPL或GPL。 

2、把MinGW-gcc440_1.zip解压到C盘,然后安装qt-win-opensource-4.8.2-mingw.exe,接着把 C:\mingw\bin 添加到系统环境变量。

3、下载QtCreator的源文件包qt-creator-2.3.0-src.zip,把压缩包里面的东西都解压取文件夹D:\qt-creator,此时的目录结构应该是D:\qt-creator\qtcreator.pro

 4、编译安装QtCreator:新建一个目录 D:\QtCreator(注意这里跟前面的qt-creator不同),再把以下内容复制到一个新建的批处理文件

 
 
  1. qmake "CONFIG+=release"  
  2. make 
  3. nmake INSTALL_ROOT="D:\QtCreator" install 

把批处理文件保存到 D:\qt-creator,双击运行。

5、批处理成功执行后,把 D:\qt-creator\bin 里面的dll文件复制到 D:\QtCreator\bin ,如果可以双击运行 D:\QtCreator\qtcreator.exe,说明QtCreator安装编译成功!

接下来还要对开发环境进行相应的设置,留到下一章再说...

 

本文出自 “自由自我” 博客,请务必保留此出处http://hhuayuan.blog.51cto.com/1630327/913465

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值