Building Qt for Symbian 3 Devices

From Qt Wiki
Revision as of 14:12, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Building Qt for Symbian^3 devices

This guide provides information required to set up environment and build Qt libraries that can be installed on a Symbian^3 device. The produced libraries will not be binary compatible with any official Qt releases, so any applications you wish to run must be also built against these libraries.

Environment setup

The following tools are needed for building a Qt package:

  • ActiveState Perl 5.6.1 (build 638) or newer [symlab.org] – Required by Qt and Symbian toolchains.
  • ActiveState Python 2.6.x or newer [symlab.org] – Required by Symbian toolchain.
  • PDT 1.7 or newer [symlab.org] – Needed for Raptor (sbsv2) toolchain. Also includes Carbide IDE and other assorted tools.
  • PDK 3.0.3 or newer [symlab.org] – Symbian platform.
    • Note: Installing some parts of the PDK require “SYMBIAN FOUNDATION RESEARCH & DEVELOPMENT LICENSE”, but those parts are not needed to build Qt so you don’t need to worry about missing them.
  • The recommended compiler for building Qt libraries is RVCT 2.2 [symlab.org])_Quick_Start – which is not available free of charge.
    • Alternatively, RVCT 4.0 [symlab.org])_Quick_Start can be used. Unlike version 2.2, version 4.0 is available free of charge for small organizations.
  • The desired version of Qt source code – Available e.g. via Gitorius [qt.gitorious.org] or ftp [ftp.qt.nokia.com] (e.g. qt-everywhere-opensource-src-4.7.1.zip).

Required environment variables:

  • EPOCROOT environment variable must point to PDK root. E.g.
    set <span class="caps">EPOCROOT</span>=C:\\PDK\\3.0.3\\
    
  • Depending on compiler you are using:
    • RVCT22BIN, RVCT22INC, and RVCT22LIB. These need to point to
      bin
      
      ,
      inc
      
      (or
      include
      
      ), and
      lib
      
      directories under your RVCT 2.2 installation. Normally these are set by RVCT 2.2 installer.
    • RVCT40BIN, RVCT40INC, and RVCT40LIB are the corresponding variables for RVCT 4.0.
  • PATH environment variable must contain the following paths in the beginning to ensure correct tools are used.
    • \&lt;Qt source root\&gt;\\bin
      
      for qmake and Qt tools.
    • \&lt;<span class="caps">PDT</span> installation root\&gt;\\Raptor\\win32\\mingw\\bin
      
      for Mingw make.
    • \&lt;<span class="caps">PDT</span> installation root\&gt;\\Raptor\\bin
      
      for sbs tool.
    • %EPOCROOT%epoc32\\tools
      
      for required Symbian tools.

Here are sample commands you can edit to match your environment and save as setenv.bat to set up your Qt building environment:

Change to your Qt source root directory:

Set up the environment variables:

Signing certificate

A signing certificate is needed if you are not satisfied with the default self-signable set of supported capabilities for Qt libraries (i.e. LocalServices, NetworkServices, ReadUserData, UserEnvironment, and WriteUserData). The capabilities Qt libraries require depends on the capabilities of the applications you plan on running against the Qt libraries you build; the Qt libraries need at least all of the capabilities the application has. The best certificate to use would be a manufacturer’s RnD certificate, but unless you are working for a device manufacturer, you probably won’t have access to such a certificate. The next best thing is a Symbian developer certificate. See here [symbiansigned.com] for details about acquiring a developer certificate.

Building Qt

Configure Qt

Give the following command in your Qt source root directory to configure Qt:

  • Note: If you do not need Webkit, you can reduce the build time around 50% by adding “-no-webkit” parameter to configure.

Build Qt & QtWebkit

Depending on your chosen compiler, select one of commands below to compile Qt and give it at the Qt source root directory:

Installing Qt libraries to device

By default Qt libraries are built with “All -Tcb” capabilities, which requires a certificate normally only available for device manufacturers to sign. Depending on what kind of certificate you have available, you might need to patch the capabilities of the Qt libraries. To create Qt installation packages, run the following commands:

If you are content with default set of self-signable capabilities and do not have any extra certificate:

If you have a manufacturer RnD certificate and a RnD device:

If you are using developer certificate with maximum non-manufacturer capabilities:

  • Note 1:
    QT_SIS_OPTIONS=-i
    
    is simply a convenience parameter that causes automatic installation to a connected device after package is created.
  • Note 2: Infixing Qml plugins is broken in Qt 4.7.0 and 4.7.1 releases, so if the device already has Qt 4.7.x pre-installed, you will need to edit the .pkg files and remove all lines with qmldir on them before creating the package or you won’t be able to install it due to same files already having been installed by existing package. You can also expect qml plugins not working properly with infixed Qt in these releases.

Building applications

Build your own applications normally using the same make target that you used to build the Qt and use same “make sis” options. E.g. for RVCT 2.2 build using self-signed certificate, use the following commands:

  • Note: Armv6 works fine out of the box for building Qt libraries and regular Qt applications against the PDK. However, Qt applications that do not include gui need little extra work in Qt releases prior to 4.7.2. To enable building non-gui applications with armv6 for such releases, copy
    &lt;<span class="caps">PDK</span> root&gt;\epoc32\release\armv5\*\libcrt0*.lib
    
    to the corresponding folders under
    &lt;<span class="caps">PDK</span> root&gt;\epoc32\release\armv6
    
    .

Categories: