As you may know, although
Trolltech's Qt was claimed open-source even for Windows, its open source edition DIDN'T support Microsoft Visual Studio. It's very annoying. I often complained Trolltech was mean (in a strange way). However, it seems Trolltech is becoming more generous. Its latest open source edition of Qt now really supports MS Visual Studio. Gorgeous!
Below I will explain how to compile Qt/Windows open source edition in Microsoft Visual Studio 2005.
- Download the Qt source package (.zip NOT .exe) of Windows open source edition at http://trolltech.com/developer/downloads/qt/windows/
- Unzip your Qt source to a logical location (NOTE: blank spaces are not allowed), e.g., C:/QT/4.3.3/
- Open Visual Studio 2005 Command Prompt (If you are using Windows XP, it is accessible through "Start|All Programs|Microsoft Visual Studio 2005|Vistual Studio Tools|Visual Studio 2005 Command Prompt"). Change your current directory to the unzipped Qt source directory.
- Configure your installation using configure.exe. For example, I use "configure.exe -release -no-dsp -vcproj". You can type "configure.exe --help" for detailed help information.
- Once configuration is completed, you are now ready to build the library. Simply type "nmake" in the command prompt. Building the Qt library takes a long time (1 hour? maybe). Be patient, :-)
- Set up your environment.
- Add your Qt bin directory to your PATH.
- Set environment variable QMAKESPEC to win32-msvc2005
That's it. Now you can use Qt in VS 2005. Enjoy. BTW, you can find some related and useful information at
QtNodeBut note that for QT-4.3.3 (possibly for the future version too), you don't need the patch any more. That's a piece of great news. Thanks, Trolltech.
![]()