Welcome

Wheresoever you go, go with all your heart. (Confucius)

8/09/2012

Compile Qt 4.8.2 64bit library with Visual Studio 2010 Professional


Qt does not support 64bit library officially, but you can build that.
Although 64bit library is unstable, it is useful to establish 64bit environment with QT and Visual Studio 2010 professional. First of all, Visual Studio 2010 professional is installed on you system. Steps are as followings:
  1. Install Perl if Qt version is more than 4.8.0 because it use Perl to configure building.
  2. Download and install Qt libraries 4.8.2 for Windows (VS 2010).
  3. Open Visual Studio x64 Win64 Command Prompt (2010)
    • Location: Start->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio x64 Win64 Command Prompt (2010)
  4. Set up environmental variables
    > Set QTDIR=C:\Qt\4.7.1
    > Set QMAKESPEC=win32-msvc2010
  5. Update PATH variable to include %QTDIR%\bin in System environments
  6. Download the latest version of jom which speeds up Visual C++ Qt Builds by supporting parallel processes.
  7. Extract jom files to C:\Qt\jom folder
  8. Run following commands in it (every line is a different command: type it then press Enter):
    > cd c:\Qt\4.7.1
    > configure -debug-and-release -opensource -platform win32-msvc2010 -opengl desktop
    > ..\jom\jom.exe -j N
    Where N is number of CPU cores you want to utilize for Qt compilation. Larger is better.

  9. Run the following command. 
    • > ..\jom\jom.exe clean
    • One can safely shrink its size by deleting temporary files created during the process.  Note that PDB files will be deleted too. 
  10. Download and install Qt Visual Studio Add-in.
  11. Run Visual Studio 2010. Integrate just compiled Qt to IDE using menu Qt > Qt Options > Qt Versions > Add

Remarks

* Jom is nmake replacement for Qt compilation on multi-core CPU. Its parameter -j N allows to setup number of parallel processes for compilation. Number of physical CPU cores is a good choice for N.

No comments: