For my first steps with Qt, I wanted to use the 64-bit libraries of Qt 5.2.1 on Windows 7 with Visual Studio 2010; unfortunately the project doesn’t offer a binary package download for this combination, so I had to build the framework myself.
After some failures at this (mostly due to out of date tutorials and documentation on the web), I finally could create the libraries to my current liking…
Prerequisites and recommended installation order
- Microsoft Visual Studio 2010
- Microsoft Windows SDK 7.1
- Microsoft Visual Studio 2010 Service Pack 1 (needed for a 64-bit build)
- Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
Tools like Perl should be in PATH for the command prompt build environment.
You might also want to read http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/.
Getting and building Qt
There is, hidden in the small text, a link to the source code files on the Qt Project Download Page:
The source code is also available as a single zip […] file for Windows users
Extract it to an appropriate place, e.g.
C:\devel\ext\Qt\5.2.1\(if your extraction tool puts it into a sub-directory named qt-everywhere-opensource-src-5.2.1 then move the content one level up and delete this folder).
Build 64-bit DLLs with Visual Studio 2010:
Open the Visual Studio x64 Win64 Command Prompt (2010) from the start menu and navigate to
configureto set up the build, for example with these parameter values:
To get rid of the question whether you agree to the license.
Target directory, e.g. a full path like C:\devel\ext\Qt\5.2.1_64DLL
Creatings DLLs instead of static libraries.
Use Microsoft Visual C++ 2010.
Use multiple processors for compiling with Microsoft Visual C++ (-MP).
Seems to be necessary.
Because examples (esp. OpenGL ones) messed up the build.
Library for Unicode and Globalization support. This would be required for building Qt WebKit.
But Qt also supports Unicode by default and ICU seems to be on the way out for Qt’s future…
ANGLE would translate OpenGL calls into DirectX calls.
nmaketo kick-off the building process (to clean up configure after a failed build, use
nmake installto move the built binaries to the target directory.