Compiling Qt for use with Visual Studio
First, you have got to obtain the Qt open source SDK. This can be done by following this link:Open the Visual Studio Command Prompt by using the windows menu folders “Start”, “Programs”, “Microsoft Visual Studio” as well as “Visual Studio Tools” and execute the menu entry “Visual Studio Command Prompt”. Dependend on your QT version, in the prompt the following steps have to be taken:
- Change to directory
C:\Qt\2009.04\qt - Run
configure -debug-and-releaseand answer with “o” for open source and “y” to accept the license - Then run
nmake sub-src. This may take some time, because all libaries are built excluding the Qt demos. Just callingnmakewould build them, too.
Now the release and debug libaries can be found in C:\Qt\2009.04\lib. The last step is adding C:\Qt\2009.04\bin to the path:
- For this you have to open the control panel of your system
- Open “System”
- Choose tab “Advanced”
- Click on the button to set environment variables
- Add
C:\Qt\2009.04\qt\binto the path and insert a new system variableQTDIRsetting its value toC:\Qt\2009.04\qt.
The installation is finished and can be tested by running qmake -v:
QMake version 2.01a
Using Qt version 4.5.3 in C:\Qt\2009.04\qt\lib