Installing Qt 4.0 on Windows

For anyone who’s tried installing Qt4 on Windows you’ll no doubt have had a few problems. Here’s the steps I had to go through to get it working…

  • Make sure you have MinGW installed. I’m using version 4.1.0.
  • Download the file qt-win-opensource-desktop-4.0.0.zip from Trolltech’s website
  • Extract it to the directory where you want to install Qt, e.g. c:/qt/4.0.0
  • Open a command prompt and cd to the directory c:/qt/4.0.0
  • Run the configure program like this, configure -platform win32-g++. You have to use the win32-g++ platform (MinGW) because win32-msvc (MS Visual Studio) is not supported in the open source version of Qt (see here for a lively debat on the topic). If you try running configure -platform win32-msvc you’ll get to accept the license agreement but the configure program will just exit straight away with no explaination of what happened
  • Ensure that the MinGW bin directory is in your PATH environment variable. It’s very important that if you have MSYS installed that it is NOT in your PATH. If it is then the next step will fail because it picks up the cd program from MSYS and fails when trying to cd to windows formatted paths (i.e. paths using / instead if /)
  • Run mingw32-make. Note that this step takes quite some time (> 1 hour). Note also that you’ll need at about 2GB of disk space to hold all the files built as part of this step.
  • Finally add c:/qt/4.0.0/bin to your PATH environment variable. Ensure also that MinGW is on your PATH so that the Qt applications can find the MinGW binaries at runtime.

这里有个问题就是如果configure过程出现错误,怎么办?

我一直遇到的一个问题是mingw32/bin/ld.exe: cannot find -lQtGuid4 。。。

原因可能是qt安装的过程中没有自动配置成debug输出,使用qt安装目录下的一个bat文件,将qt的默认编译输出改为debug模式,中间调用的是configuration程序,但是这个过程最后是一错误告终的,还是有问题,搞不清楚

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值