Compiling Qt 4.8.x for Visual Studio 2012
Solution 1:
Qt 4.8.3 with Visual Studio 2012 x64 (should also work with 4.8.2)
Install Strawberry Perl
Download Qt 4.8.3 source code from http://qt-project.org/downloads
-
Go to
mkspecs\win32-msvc2010
. Openqmake.conf
and change:QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
to:
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
Replace
qt-everywhere-opensource-src-4.8.3-x64\src\3rdparty\webkit\Source\JavaScriptCore\wtf\HashSet.h
by thisHashSet.h
.Start "VS2012 x64 Native Tools Command Prompt"
Switch to Qt 4.8.3 source directory (the directory that contains
configure.exe
)-
Run:
configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
-
Followed by:
nmake
I programmed a tool called BlueGo which automatically downloads Qt 4.8.3 and builds it with VS2012 x64: http://bluego.vertexwahn.de (also works with VS2010 x64) (it just does what I described above automatically)
Solution 2:
Qt 4.8.4 needs less tweaking than described by Vertexwahn above.
- The HashSet still has to be fixed (see fix of Vertexwahn) after Qt has been extracted from archive.
- Platform win32-msvc2012 is supported out-of-the-box though (also works for 64bit in the 64bit environment, don't ask why they name it Win32).
So simply replace the HashSet.h and compile.
Solution 3:
Just creating a win32-msvc2012 directory with the changes below didn't work for me, there is more editing necessary. What exactly is necessary is described in the thread you already linked.
What I did, I went to win32-msvc2010.
There, open qmake.conf and change
QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
to
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
Then I could configure using win32-msvc2010.
Also, I used these changes: http://qt-project.org/forums/viewthread/17771 (alzi's Version)