Wednesday 7 October 2009

Setting up qt4 with visual studio 2005 and 2008

It is not clear (or wasn't to me) how to use QT4 with Visual Studio. The key to the problem is that you need to re-compile QT4 for Visual Studio. If you are not using MingGW at all then you can do all this in the original QT directory. Otherwise copy the entire c:\qt\2009.03 directory to something like c:\qt\2009.03_vs2008

Open a VS command line prompt so that all the env vars are set up.

Run the configure script, my suggestion is:
C:\Qt\2009.03\qt>configure -no-qt3support -no-opengl -platform win32-msvc2005 -no-libtiff -no-dbus -no-phonon -no-phonon-backend -opensource -debug-and-release

Let it do it's thing

Then type nmake to build the VS libraries

Notes:
Use nmake confclean to clean the directory before running a new configure cmd