Here is how I compile the Qt Windows Opensource version.
As it uses mingw, which sets INCLUDE and LIB environment variables, and this causes compilation errors in some machines. So after talking to hte trolltech support team( and ya, they answers question from Opensource guys ). they have asked me to unset these varaibles. So I edited my qtvars.bat ( C:\Qt\4.3.1\bin\qtvars.bat ) file as follows

Qt Code:
  1. @echo off
  2. rem
  3. rem This file is generated
  4. rem
  5.  
  6. echo Setting up a MinGW/Qt only environment...
  7. echo -- QTDIR set to C:\Qt\4.3.1
  8. echo -- PATH set to C:\Qt\4.3.1\bin
  9. echo -- Adding C:\MinGW\bin to PATH
  10. echo -- Adding %SystemRoot%\System32 to PATH
  11. echo -- QMAKESPEC set to win32-g++
  12.  
  13. set LIB=
  14. set INCLUDE=
  15. set QTDIR=C:\Qt\4.3.1
  16. set PATH=C:\Qt\4.3.1\bin
  17. set PATH=%PATH%;C:\MinGW\bin
  18. set PATH=%PATH%;%SystemRoot%\System32
  19. set QMAKESPEC=win32-g++
  20.  
  21. if not "%1"=="compile_debug" goto END
  22. cd %QTDIR%
  23. echo This will configure and compile qt in debug.
  24. echo The release libraries will not be recompiled.
  25. pause
  26. configure -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg
  27. cd %QTDIR%\src
  28. qmake
  29. mingw32-make debug
  30. :END
To copy to clipboard, switch view to plain text mode 
Notice the set LIB= and INCLUDE= ( linenumber 13, 14 )
Works for me