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.
- Open a command prompt and cd to the directory
- 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 debate on the topic). If you try running
configure -platform win32-msvcyou’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 of /)
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\binto your PATH environment variable. Ensure also that MinGW is on your PATH so that the Qt applications can find the MinGW binaries at runtime.