This is the trickiest installation I have done. The trick is to have the right information and it is that on a Windows machine only the commercial release is compatible with Microsoft Visual Studio so if you are stuck with strange errors creeping up when you try to install open source edition with msvc option you know where is the problem. Thus, for Qt open source edition install a mingw compiler on your system. The mingw homepage (mingw.org) sucks, the download links have nothing to download, it is the worst website of all open source projects. The work around for this is to download Bloodshed Dev C++. This will install everything that you need to start your installation for Qt. Do remember that if you have microsoft visual studio installed clear the environment variables MSYS, LIB and INCLUDE (NOTE:-To check all the environment variables that are set on your machine, type the following command: set on a windows console.). This is done using "set" command from the console as follows
- set LIB=
- set INCLUDE=
This clears any entries for visual studio from LIB and INCLUDE. Now comes the steps that you need to take to install qt. I am using Qt-4.3.3 open source edition.
- Unzip the Qt folder to C: drive so you have a qt source folder in C:\
- I have Bloodshed Dev C++ installed in C:\Dev-Cpp. Add the bin and library sub folder of this folder to your PATH variable using PATH=%PATH%;C:\Dev-Cpp\bin;C:\Dev-Cpp\lib. This would relieve you all the hassles of finding and installing a mingw compiler as Bloodshed Dev C++ automatically installs them for you. Also change your LIB and INCLUDE environment variables (after clearing the visual studio entries) to point to Dev-Cpp and Qt lib and include folder. I made the following changes on the console: set LIB=%LIB%C:\Dev-Cpp\lib;C:\qt-win-opensource-src-4.3.4\lib( I unzipped Qt folder to C:\ drive, if you choose some other path then change it accordingly). set INCLUDE=%INCLUDE%:C:\Dev-Cpp\include;C:\qt-win-opensource-src-4.3.4\include.
- Then switch to the qt folder i.e where you have unzipped the qt source folder. In my case it is C:\qt-win-opensource-src-4.3.4. From there type the command: configure -platform win32-g++ to configure Qt for your system. The command will only fail if you haven't set the path for the mingw based compiler correctly other wise in a matter of 5-10 minutes your version of qt will be ready to be built.
- When qt is configured run the following command to build qt for your system: mingw32-make. If you face any errors during this step it is most likely that you have visual studio installed and environment variables like LIB, INCLUDE AND MSYS set to point to exe's needed by visual studio. Clearing these variables and setting them as I have explained above will relieve you of your hassles.
- Finally add Qt bin directory's path to your PATH variable as PATH=%PATH%;C:\qt-win-opensource-src-4.3.4\bin (in my case).
I hope this does the trick for all of you geeks who were hitting a dead end while installing Qt on your windows machines. For any further queries you can send a comment and I will try to answer them to the best of my abilities.