Symbian development using Linux

Published Wednesday April 21st, 2010
35 Comments on Symbian development using Linux
Posted in Build system, C++, S60, Symbian

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.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Build system, C++, S60, Symbian

35 comments

Hey, nice post! It is always good to have development tools available on Linux as well.
Anyway, there is this post http://lizardo.wordpress.com/2010/02/18/installing-qt-for-symbian-sdk-4-6-2-on-linux/ that is interesting to share as well if you want to develop QT for Symbian using Linux.

Cheers.

paulb says:

Great post Thomas!

Check out http://blog.symbian.org/2010/04/21/stepping-toward-symbian-open-source-tools-on-linux-and-mac/ for more information about the underlying tool chain work from CodeSourcery. Hopefully, it will also enable similar follow up integrations for Mac developers πŸ˜‰

Hey!

Im happy to hear Qt for Symbian will get official linux support.
Yes, Lizardos post is quite good, as well as his tools, and is already working with Qt 4.6.x.

I’ve written a small article about using Qt for Symbian on Linux with Eclipse.
http://www.w-bremer.de/en/howtos/69-S60Qt-Eclipse

Regards

Giorgio says:

Great post,
but when we will finally have a native sdk without patching windows sources and without using wine to exec the windows executables ?
Regards

Stelian says:

Is it possible to achieve the same on the Mac?

Marco says:

Hi,

Thanks for the tutorial, it gave my Ubuntu a new life.
I followed the tutorial and when I was compiling qt got this error “armcc: Command not found”. Does anyone knows how to solve it?

thanks in advance

Satish says:

That’s nice, any future plans to support Qt apps on Android/iPhone (ahem!) ? The benefit of writing once and executing on all three major mobile platforms I think need not be explicitly told

almostlabs says:

Interesting question … is Qt a prohibited “intermediary translation or compatibility layer or tool” even if it is written in C++, C and Objective-C?

Leto says:

Hey guys, please don’t forget Mac programmers, i know we are a minority, but. The work is done Linux, for Macs is just one more little step.

Ipeev says:

What Nokia phones will be able to run this?

Thomas Zander says:

Hey, guys.
first the guys that posted more links, thanks!. The goal I have is that we get a great way of building Symbian apps and a standard way of working. The current official one is dependent on an external makefile generator, which makes it harder to maintain and more vulnerable to fragmentation. Doing the work inside of the Qt repo makes it easiest to keep stable and up to date.

@Giorgio getting native tools is certainly something I want too, and work is going into that direction. The tools are in the process of being open sourced by the Symbian foundation so we should get there. Unfortunately older versions are not getting opened and the current versions generate files that older phones can’t use. I’m not giving up on the angle, though. But its a trade-off.

@Stelian and @Leto A mac version would be sweet, I agree. This effort likely helps there and hopefully it becomes easy enough soon πŸ™‚

@Marco thats due to a silly mistake in my instructions. Sorry about that. I fixed the blog as the configure line was wrong. Please resume from the configure part and you should get much further.

@Satish kind of off topic, eh? πŸ™‚ I think there is some non-official work going on by a 3rd party. Just google for it!

@Ipeev ‘over 130million devices’ πŸ˜‰ http://qt.nokia.com/products/platform/symbian

KarlNapf says:

Satish: http://code.google.com/p/android-lighthouse/ has a android port of Qt.

khris says:

But, still, too difficult to use. πŸ™

Very nice post.

Looking forward to see this feature on Qt 4.7.

Hello. This seemed like a great news, but…
I tried this and ran into a lot of problems:
1) symbiansdk-gcce.diff.gz does not apply cleanly at all. Seems like my S60 sdk is different from yours.
2) During make, I had to apply the following patch to build Qt: . This, again, suggests that something’s wrong with my SDK, but I really used S60_5th_Edition_SDK_v1_0_en.zip, s60_open_c_cpp_plug_in_v1_6_en.zip and gnupoc-package-1.15.tar.gz. Any idea what could be wrong?
3) During make, elf2e32 once crashed (that may be wine’s fault) while producing QtDeclarative.dll.
4) After all that, I wasn’t surprised that upon installing Qt.sis to a phone (5800XM) a building a simple hello world application, it did not work.
Any ideas what I’m doing wrong? Thanks!

The patch url from 2) got lost somehow, here it is: http://store.lisk.in/tmp/qt-symbian-wtf.patch

David says:

I’m happy to read this post. Will look forward to it.

Tofe says:

Great news! I was really looking forward to that.

There are still a quite high number of steps to follow, but it looks like this could be all gathered together in a nice little shell script… isn’t it ?

Jason Bourne says:

Huh huh, this tell a lot about Nokia’s support for open development environments. If things are done as they should be done you should NOT need to use and run anything with Wine or anything from Windows. QT is native Linux application and I can build anything with that. This kind of “puzzles” is just something you don’t need. Ok – I understand that Symbian is legacy OS for basic mobile phones and these kind of tricks are needed to get support for OS from 90’s. If SKD environment is so full of mess – how about Symbian it selves?

You should dump the Symbian and start support Meego 100%. Symbian is dead!

FUCK THIS MESSY SECURITY CODE – FUCK FUCK

kevinclcn says:

Thomas, I post here because I don’t know how to contact with you. I read your blog about text zooming: http://labs.trolltech.com/blogs/2008/08/04/zooming-text/, that is what I need, but I can’t get the sample code. Where can I get the code. Thank you very much!

Alexei Sheplyakov says:

Unfortunately the (64-bit) installer segfaults. Here is a backtrace:

(gdb) bt
#0 0x00000000005beab3 in KDSysInfo::Volume::availableSpace() const ()
#1 0x0000000000440dca in QInstaller::ReadyForInstallationPage::initializePage() ()
#2 0x0000000000d9e22d in QWizardPrivate::switchToPage(int, QWizardPrivate::Direction) ()
#3 0x0000000000d9e49f in QWizard::next() ()
#4 0x0000000000d9ee83 in QWizard::qt_metacall(QMetaObject::Call, int, void**) ()
#5 0x000000000048e875 in QInstaller::Gui::qt_metacall(QMetaObject::Call, int, void**) ()
#6 0x00000000010b6641 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
#7 0x0000000000eda422 in QAbstractButton::clicked(bool) ()
#8 0x0000000000c67e7b in QAbstractButtonPrivate::emitClicked() ()
#9 0x0000000000c68ed5 in QAbstractButtonPrivate::click() ()
#10 0x0000000000c6912b in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
#11 0x00000000009dc14b in QWidget::event(QEvent*) ()
#12 0x0000000000c6828f in QAbstractButton::event(QEvent*) ()
#13 0x0000000000cfa9ce in QPushButton::event(QEvent*) ()
#14 0x000000000098b71f in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
#15 0x0000000000990f16 in QApplication::notify(QObject*, QEvent*) ()
#16 0x00000000010a3ce4 in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
#17 0x0000000000991e10 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool) ()
#18 0x00000000009fc4aa in QETWidget::translateMouseEvent(_XEvent const*) ()
#19 0x00000000009fb25b in QApplication::x11ProcessEvent(_XEvent*) ()
#20 0x0000000000a20ea2 in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) ()
#21 0x00007ffff5c756c2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#22 0x00007ffff5c79538 in ?? () from /lib/libglib-2.0.so.0
#23 0x00007ffff5c796ec in g_main_context_iteration () from /lib/libglib-2.0.so.0
#24 0x00000000010c57a5 in QEventDispatcherGlib::processEvents(QFlags) ()
#25 0x0000000000a20cbf in QGuiEventDispatcherGlib::processEvents(QFlags) ()
#26 0x00000000010a2de5 in QEventLoop::processEvents(QFlags) ()
#27 0x00000000010a31cd in QEventLoop::exec(QFlags) ()
#28 0x00000000010a4b7a in QCoreApplication::exec() ()
#29 0x000000000041899b in main ()

Alexei Sheplyakov says:

Oops, it looks like I’ve posted to the wrong thread. Sorry for the noise.

TheRohan says:

Just checked out this great tutorial and thought of sharing it with you guys.

This tutorial guides you in getting started with Qt application development. The document covers the following topics: downloading and installing the Nokia Qt SDK, creating your first project, running it in the simulator, and deploying the application to a device.

For more info to this visit http://bit.ly/8XKBw3

Loudi says:

unable to compile, i always have SVGTBINENCODE.exe segfaults (with a wine dialog box)…

trace :
mifconv ./qftp.mif /c32 /home/loudi/qt/qt-everywhere-opensource-src-4.7.0-beta1/src/s60installs/qt.svg
MifConv version 1.11 build (50, SVG stand-alone).
Checking: homeloudiqtqt-everywhere-opensource-src-4.7.0-beta1srcs60installsqt.svg
Choosing…
Used from: homeloudisymbian-sdkepoc32toolsSVGTBINENCODE.exe.
Convert files…
wine: Unhandled page fault on read access to 0x00000003 at address 0x3 (thread 001e), starting debugger…

if i passthrough, make sis & install the resulting Qt.sis, I’ve a error msg on my phone (unsigned app or whatever)

still hope for the 4.7 final to works fine πŸ™‚

pdrummond says:

I am having a problem building – I have tried twice now but it always falls over when building the examples, specifically collidingmice (but I have tried other examples and they error too). The error is as follows:
make[3]: Entering directory `/home/pdrummond/qt/build/examples/graphicsview/elasticnodes’
mifconv ./elasticnodes.mif /c32 /home/pdrummond/qt/src/qt4.7.0-beta1/src/s60installs/qt.svg
Semicolon seems to be missing at /home/pdrummond/opt/symbian-sdk//epoc32/tools/mifconv line 48.
String found where operator expected at /home/pdrummond/opt/symbian-sdk//epoc32/tools/mifconv line 49, near “echo “executing $PGM.exe””
(Do you need to predeclare echo?)

Any ideas?

pdrummond says:

In case anyone else is having the same problems as me, the above error occurred because I applied the patch wrong.

When the patch says this:

The next patch would create the file epoc32/tools/def2dll,
which already exists! Assume -R? [n]

ensure you enter ‘y’ each time this prompt appears!

Paul Drummond

begining.mob.dev says:

Interesting, but is there an emulator which runs on linux or do I have to test my code directly on the device?

mortenvp says:

I have some problems getting it working. When I follow the guide everything seemed to work, I only had one problem when running make sis in the examples folders:
Could not execute elftran at …../bin/patch_capabilities.pl line 244.

Looking at the epoc32/tools directory containing elftran I found that it seem to miss a shell script to kick wine into action. So doing a simple:
cp makesis elftran && chmod u+x elftran

Worked, so now I could create both the Qt.sis and examples sis files. However, when I try to run the examples on a device (tried N95 and 5800) nothing happens. I have installed the OpenC stuff on the phone.

Any ideas?

Ilgaz says:

PIPS and OpenC binaries for users (e.g. binary installer) needs to be downloaded from very questionable, sometimes full of viruses/trojans sites.

Forget the joke like Linux install, users are put into huge risk since they have to rely on 3rd party sites (even rapidshare!) if they want to install anything related/depending to PIPS/OpenC.

I actually downloaded that ZIP file trusting to “unshield” command on OS X, it seems Nokia packaged the CAB files in such a weird method that poor tool exits with abort trap.

mortenvp says:

Hi Ilgaz,
You don’t need to download the PIPS or OpenC from any questionable sites. Just take it directly from Nokia e.g. http://www.forum.nokia.com/info/sw.nokia.com/id/91d89929-fb8c-4d66-bea0-227e42df9053/Open_C_SDK_Plug-In.html

detro says:

Hi.
How do I build QtWebKit for Symbian as well?

I need to run QML with WebView inside, and I can’t without that fundamental module.

Thanks

detro says:

OK, got it. To build QtWebKit you NEED ARM. Otherwise GCCE just can’t do the job.

TimM says:

Hi,

This is a very late reply but I’m leaving it here for people who stumble across this page and might come away with only apart of the story.

I don’t mean to be competitive but I wanted to say here for the sake of people like Jason who might be frustrated that the Symbian Foundation indeed has an officially supported Symbian Build System that runs on Linux and Windows and has been hacked by at least one person to work on the Mac. It’s called Raptor (aka sbsv2). It’s the official build system for ^3 and ^4 within that big company that I’m not sure if I’m allowed to name.

Here is the link:

http://developer.symbian.org/wiki/index.php/Category:Raptor_Build_System

There is an excellent page about how to get it and use it all here:
http://developer.symbian.org/wiki/index.php/Bootstrapping_the_Symbian_build_tools_on_Ubuntu_Linux

Qmake has been adapted to generate Raptor inputs (bld.infs and mmps) although it uses it’s formerly official name of “sbsv2” to identify it. So far I haven’t worked out how to get a version of this adaptation that handles linux paths correctly but I bet it exists and I haven’t looked hard enough – it seems like a fairly minor issue though and I expect that it will be sorted out in 4.7.

So where we are is a completely linux-functional build system with not-perfect linux-Qt integration but nearly. That is very significant. I am one of the Raptor developers and most of our team use and develop Raptor on Linux.

There are still some problematic tools (svgtbinencode,mifconv etc) – I’m not sure how much they matter to Qt-based programs but they are being converted and my only concern is about how long it will take for the SF to get them.

Regards,

Tim M

TimM says:

Hi.

This is a very late reply but I’m leaving it here for people who stumble across this page and might come away with only apart of the story. Sorry if it’s double-posted – the security code is almost unreadable and I’m not sure what happened to my last attempt.

I don’t mean to be competitive but I wanted to say here for the sake of people like Jason who might be frustrated that the Symbian Foundation indeed has an officially supported Symbian Build System that runs on Linux and Windows and has been hacked by at least one person to work on the Mac. It’s called Raptor (aka sbsv2). It’s the official build system for ^3 and ^4 within that big company that I’m not sure if I’m allowed to name.

Here is the link:

http://developer.symbian.org/wiki/index.php/Category:Raptor_Build_System

There is an excellent page about how to get it and use it all here:
http://developer.symbian.org/wiki/index.php/Bootstrapping_the_Symbian_build_tools_on_Ubuntu_Linux

Qmake has been adapted to generate Raptor inputs (bld.infs and mmps) although it uses it’s formerly official name of “sbsv2” to identify it. So far I haven’t worked out how to get a version of this adaptation that handles linux paths correctly but I bet it exists and I haven’t looked hard enough – it seems like a fairly minor issue though and I expect that it will be sorted out in 4.7.

So where we are is a completely linux-functional build system with not-perfect linux-Qt integration but nearly. That is very significant. I am one of the Raptor developers and most of our team use and develop Raptor on Linux.

There are still some problematic tools (svgtbinencode,mifconv etc) – I’m not sure how much they matter to Qt-based programs but they are being converted and my only concern is about how long it will take for the SF to get them.

Regards,

Tim M

Jeremy says:

Just getting to this now….

Noticed that the link in the article to β€œSourcery G++ Lite Edition” was broken but managed to find it through these pages:
http://blog.symbian.org/2010/04/21/stepping-toward-symbian-open-source-tools-on-linux-and-mac/
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite

Commenting closed.

Get started today with Qt Download now