Tuesday, 28 June 2011

Compiling Qt mobility for Simulator on Windows

These days I am working on a Symbian application using Qt 4.7.3 and Qt mobility 1.2.0.

Since the last version of Qt SDK doesn't ship Qt mobility 1.2.0 for the simulator, I had to recompile it myself. Since it took me some time, I write a step by step how to to help people who are trying to do the same thing.

The only real problem is that the SDK for windows doesn't include all the headers files needed to compile the sources. So I copied them from my linux installation of the SDK.
  1. Make sure you have the latest version of Qt SDK. As I write it it is the version 1.1.2, including Qt 4.7.3 and Qt mobility 1.1.3. In my case the SDK is installed into c:\QtSDK.
  2. Get the sources of qt mobility for the simulator from its git repository. Note that it is not the same repository as for Symbian or desktop version.
  3. Two directories are missing in the the simulator source on windows:
    • c:\QtSDK\Simulator\Qt\mingw\include\private
    • c:\QtSDK\Simulator\Qt\mingw\include\QtGui\private
    So what I did is copied those directory from my linux partition where Qt SDK was installed (from the directory ./QtSDK/Simulator/Qt/gcc/include).
  4. In a windows console, set up the PATH to include all the needed tools. You need qmake from the Simulator SDK, perl, and makew32-make:

    set PATH=c:\QtSDK\Simulator\Qt\mingw\bin;%PATH%
    set PATH=c:\QtSDK\mingw\bin;%PATH%
    set PATH=c:\QtSDK\Symbian\tools\perl\bin\;%PATH%

  5. Run configure. In my case I didn't need the messaging module and since it requires dependencies I removed it from the list of modules using the -modules argument of the command:

    configure -modules "bearer contacts gallery location publishsubscribe multimedia systeminfo serviceframework sensors versit organizer feedback connectivity"

  6. Run the make command:

    mingw32-make

  7. Finally install everything:

    mingw32-make install
After this I was able to compile and run applications using qt mobility 1.2.0 on the simulator.