Back to Blog home

Symbian development using Linux

Published on Wednesday April 21, 2010 by Thomas Zander in Build system C++ S60 Symbian | Comments

Programming your application or library based on Qt has always had the promise that you can deploy your application on many different platforms. Development of those applications can, likewise, happen on many different platforms. QtCreator runs on Windows, Mac & Linux among others.
Since Qt4.6 Symbian is also one of those platforms to deploy on, your Qt apps can run on one of the many many Symbian based phones already out there.
For developers to be able to deploy to Symbian there was one problem, you'd have to use Windows as your development platform. Here in Qt Development Frameworks we recognize that a large amount of development is done on Linux. Especially open source developers have made the point that developing Symbian applications should work on Linux.

So, today, I'm happy to announce that developing Qt applications for the Symbian platform is possible on Linux with the upcoming Qt4.7. This will be experimental for now. Please give feedback on how well it works for you!

What this means is that developers using a Linux system can use a freely available cross-compiler and the also freely available Symbian tools to create applications for a Symbian based phone.
Developers that are working on Qt itself will now be able to do so on Linux too.

Preparing with a Qt compile
Symbian has a bad reputation of ease of development, you would be excused if you think 'preparing' means something along the lines of including some soul-searching and prayer. That's all to change, I'm convinced, with Qt entering this arena.
The preparations here are essentially the download of the required tools.

First you need to compile Qt for Symbian. This is a step you would be able to avoid after the final 4.7 is out and you can just download a binary. You can either use the upcoming Qt47-beta or clone the git repository; http://qt.gitorious.org/qt/qt

Second we need a compiler that can cross compile to the arm instruction set which is what phones use; there are two compilers that are known to work, the rvct-2.2 compiler and gcce. As rvct is not freely available I'll focus purely on gcce here. Gcce can be found at http://www.codesourcery.com the "Sourcery G++ Lite Edition" is what you are looking for. Direct link

Since we are going to compile for a Symbian platform, we need to download the headers and libraries etc to link to. The things we need are included in the "S60 5th Edition SDK for Symbian OS"
Apologies for the requirement to register there.

From the same site we need s60_open_c_cpp_plug_in_v1_6_en.zip

These downloads were created for Windows users and as such we need to massage it a bit to be useful for Linux use. We do NOT use the setup.exe included in there, instead the way to do this is to use the gnupoc package; http://www.martin.st/symbian/ version 1.15 worked for me.
After making sure the Linux command 'patch' is available on your system and unpacking the gnupoc archive you can
cd gnupoc-package-1.15/sdk
./install_gnupoc_s60_50 ~/S60_5th_Edition_SDK_v1_0_en.zip ~/symbian-sdk

and
./install_openc_16_s60 ~/work/s60_open_c_cpp_plug_in_v1_6_en.zip ~/symbian-sdk

Last step is to download this symbiansdk-gcce.diff.gz and after unzipping apply it to your new ~/symbian-sdk directory using;
cd ~/symbian-sdk
patch -p0 < symbiansdk-gcce.diff

The next step is to install 'wine' to run some of the tools. Your Linux distro likely has it, so use your distro package manager to install it.
Check with 'wine ~/symbian-sdk/epoc32/tools/unzip.exe' to see if it works. You should get the help message from 'unzip' after calling the above command.

To make the buildsystem work smoothly we copy 3 utils into the 'windows' directory to make sure its always in the path; the make.exe, mifconv.exe and the uidcrc.exe files that are stored in the ~/symbian-sdk/epoc32/tools/ should be copied to ~/.wine/drive_c/windows/ dir.
The running of 'unzip.exe' above should have taken care of creating the 'windows' dir.

Setup environment
we need to export some variables; you likely want to add these lines to your $HOME/.bashrc or similar.
export EPOCROOT=$HOME/symbian-sdk/
QTDIR=$HOME/build/qt
gcceDir= full/path/to/arm-2009q3/bin
export PATH=$QTDIR/bin:$EPOCROOT/epoc32/tools:$gcceDir:$PATH

Compile Qt; call configure and 'make'.
It is strongly suggested to do out-of-source building. Also called 'shadowbuilds'. This leaves the source tree free from any auto-generated files. So we do that here.
In the first step you downloaded the Qt sources, probably in a directory like $HOME/qt Go ahead and create a new directory called $HOME/build/qt, then cd into that newly created directory and run;
$HOME/qt/configure -platform linux-g++ -xplatform symbian/linux-gcce -arch symbian -no-webkit
make
cd src/s60installs
make sis

When all this went well you should have a Qt.sis in your build/qt/lib/ dir. Read on for what that gives you.

What next?
a file with extension .sis or .sisx are essentially installer packages that Symbian devices take. You can use a usb cable or other means to get a sis file onto your device and then click on the file in a filebrowser to install it.
Qt has some dependencies that you may want to install first, if you skip this part your apps likely just crash at startup. Be warned :)
The follwing sis files are present in the symbian-sdk you downloaded before, so you can copy them to the device and should install them all.
nokia_plugin/openc/s60opencsis/openc_ssl_s60_1_6_ss.sis
nokia_plugin/openc/s60opencsis/pips_s60_1_6_ss.sis
nokia_plugin/opencpp/s60opencppsis/stdcpp_s60_1_6_ss.sis

On top of that you might want to install these for debugging purposes;
nokia_plugin/openc/s60opencsis/stdioserver_s60_1_6_ss.sis

If we really want to actually see some results, go to an example and install that one too;
cd ~/build/qt/examples/widgets/wiggly
make sis

and then install the wiggly.sis on your device like above. You should find a new folder with "QtExamples" where it can be started from.

Extra targets and Qt docs
As noted above; the Symbian based qmake generates a Mkefile that has an extra target called 'sis'. More commands will likely be added later, but this is the essential one for now.
More info about Qt at; http://doc.trolltech.com/4.7-snapshot/how-to-learn-qt.html

What's still missing
This is not finished in the way that we'll stop working on this, there are too many steps still in the above instructions. This has to get easier still, we'll keep working on that. If you hit any issues that took longer than needed to figure out, please tell us in a comment :)

One known issue is that Symbian has a different way of doing binary compatibility; one that is not implemented in this buildsystem yet. In other words; you need to build any application against the exact same build of Qt as you have on the device.

Subscribe to Our Blog

Stay up to date with the latest marketing, sales and service tips and news.

The blog comment system has been migrated to a new platform. If you face any issues, please let us know via feedback@qt.io.