Running Qt for S60 SDK on Linux

*** These instructions have been superseded by the GnuPoc and Qt for Symbian unofficial installers, described in this post***


Update (2009-08-04): fixed qt_s60_gnupoc.patch (thanks grego), plus a few text additions.
Update (2009-08-21): update instructions to support S60 5.0 too.

A while ago I started playing with S60 programming. After downloading rather big SDK files and following instructions from, I was able to build simple “hello world” applications written in C++, on Linux.

Then I remembered reading about an experimental Qt port to S60. I wanted to try it, given that I also began playing with Qt a while ago. To my surprise, I could not find any actual instructions on how to do that on Linux, although I found a few requests for it in comments from Qt Labs blog posts.

So, without further delay, I describe below the steps I followed to build Qt applications for S60 devices on Linux. These instructions are provided as an extension to those on Martin’s page, so be sure to read it too. But given that some patches are needed on top of Martin’s tools, I will show the full instructions here.

Note: these instructions were tested only in the following environment:

  • x86 32-bits
  • Ubuntu 8.04
  • S60 3.1 (N95) and S60 5.0 (5800 Xpress Music)

I tried making it work for my 3.0 MR based device, but it seems that I need to recompile all Qt using the proprietary ARM RVCT compiler. If someday I make it work, I’ll post instructions for it too.


Download all required files:

(many thanks to Francisco Keppler for hosting the last two files on his web site!)


  1. First, set some environment variables to be used on the following steps (feel free to modify them to install the SDK on some other location). NOTE: these variables are not necessary after installation.
  2. # root directory where all SDK files will be installed
    # toolchain directory
    # S60 SDK directory (replace "3.1" with "5.0"
    # for S60 5.0)
    # Qt SDK directory
    # wrapper directory (used by gnupoc)
    # where all downloaded files are located

  3. Install ARM toolchain:
  4. mkdir -p $TOOLCHAIN_DIR
    tar -C $TOOLCHAIN_DIR -xvjf \

  5. Unpack gnupoc sources and apply the patch that adds Qt/S60 support:
  6. tar -xvzf $SRC_DIR/gnupoc-package-1.13.tar.gz
    cd gnupoc-package-1.13
    patch -p1 -i $SRC_DIR/qt_s60_gnupoc.patch

  7. Install gnupoc:
    • For S60 3.1:
    • cd sdks
      ./install_gnupoc_s60_31 \
        $SRC_DIR/ \

    • For S60 5.0:
    • cd sdks
      ./install_gnupoc_s60_50 \
        $SRC_DIR/ \

  8. Install gnupoc wrappers and native tools:
  9. ./install_wrapper $WRAPPER_DIR
    cd ../tools
    ./install_eka2_tools $TOOLCHAIN_DIR
    # adjust EKA2TOOLS variable to point to correct location
    sed -i "s,EKA2TOOLS=.*,EKA2TOOLS=$TOOLCHAIN_DIR/bin," \

  10. Install OpenC (skip this step if using S60 5.0):
  11. cd ../sdks
    chmod +x
    ./ \
      $SRC_DIR/ \

  12. Finally, install Qt/S60 (it will take some time because some tools need to be compiled for Linux):
  13. chmod +x
    ./ \
      $SRC_DIR/qt-embedded-s60-preview-4.5.2-tower.exe \
      $S60_SDK_DIR \
      $QT_S60_DIR \


After installation is completed, the usage is very simple. You need to setup a few environment variables, so tools like qmake, bldmake, abld, makesis etc. are found:

export EPOCROOT=$S60_SDK_DIR/ # trailing "/" is required!
export QMAKESPEC=$QT_S60_DIR/mkspecs/symbian-abld

Optionally, you can create a file with the lines above, using this command:

cat > $GNUPOC_ROOT/ << EOF
export EPOCROOT=$S60_SDK_DIR/ # trailing "/" is required!
export QMAKESPEC=$QT_S60_DIR/mkspecs/symbian-abld

Then, every time you need to set the variables, you could simply use:


Note the “.” (dot) before the It says that the contents of the file will be run in the current shell session, as if you typed them by hand.

To actually build some Qt code, use these commands:

cd path/to/source
qmake # assuming the code already has a .pro file
make DEL_FILE=rm ABLD=abld release-gcce
makesis -c <project>_gcce_urel.pkg <project>.sis

And to clean the source:

make DEL_FILE=rm ABLD=abld distclean


  • Be sure to use qmake from Qt/S60. Otherwise the generated Makefiles will be for your host system
  • The trailing slash on the EPOCROOT variable is important

Known issue and workaround

The .sis file generated by the instructions above, although installable on the device, does not actually work (clicking on the application icon makes the phone “hang” for a while, but then it returns to the Symbian menu). The workaround is to compile and link some files from Qt/S60 sources directly into the application. For that, just add a “qts60main.pri” file to your application’s source directory, with the following content:

qts60mainapplication.h \
qts60mainappui.h \
qts60mainapplication.cpp \
qts60mainappui.cpp \
qts60main.cpp \
qts60maindocument.cpp \
LIBS -= qtmain
QMAKE_LIBS -= qtmain
"START RESOURCE s60main.rss" \
"TARGETPATH /resource/apps" \

Edit the .pro file and add this line:


Then try again the sequence of commands listed on the previous section (qmake; bldmake …). I’m not sure why this happens, and I need to check whether this is an issue specific to Linux.


  • Remove need to set “DEL_FILE=rm ABLD=abld” when calling make distclean/relase-*
  • Send patches to Martin’s gnupoc and Qt/S60
  • Investigate issue with s60main static library not working
  • Compile Qt/S60 from sources on Linux
  • Make it work with S60 3.0 too (although Qt/S60 does not support it officially)
  • Make Symbian emulator (epoc.exe) work under Linux (currently it crashes under WINE)

About lizardo

My hobby: figure out how systems are expected to work; induce them to work unexpectedly; and responsibly disclose.
This entry was posted in General and tagged , , , . Bookmark the permalink.

12 Responses to Running Qt for S60 SDK on Linux

  1. Paulo Cesar says:

    Finally! Thanks for the instructions, I will try it on my N78

  2. grego says:

    Didn’t quite work for me, failing in the last step with:

    patching file bin/syncqt
    Hunk #1 FAILED at 41.
    Hunk #2 FAILED at 653.
    Hunk #3 FAILED at 791.
    Hunk #4 FAILED at 806.
    4 out of 4 hunks FAILED — saving rejects to file bin/syncqt.rej
    patching file mkspecs/common/symbian/symbian.conf
    Hunk #1 FAILED at 92.
    Hunk #2 FAILED at 127.
    2 out of 2 hunks FAILED — saving rejects to file mkspecs/common/symbian/symbian.conf.rej
    patching file qmake/generators/symbian/symmake_abld.cpp
    Hunk #1 FAILED at 293.
    1 out of 1 hunk FAILED — saving rejects to file qmake/generators/symbian/symmake_abld.cpp.rej
    patching file src/s60main/qts60mainappui.cpp
    Hunk #1 FAILED at 159.
    1 out of 1 hunk FAILED — saving rejects to file src/s60main/qts60mainappui.cpp.rej
    Removing temporary files…
    harri@pluto:~/gnupoc-package-1.13/sdks$ less
    harri@pluto:~/gnupoc-package-1.13/sdks$ ls /home/harri/Download/S60/qt

  3. grego says:

    Btw. rerunning the last step claims that “Everything is Ok”, but that is not quite true yet.

    I would be very nice to get this working, so let me know if you need any other info.

    • grego says:

      Patch failed because of dos line endings, here is a patch:

      *** 2009-08-04 11:15:49.000000000 +0300
      — 2009-08-04 12:36:59.000000000 +0300
      *** 44,49 ****
      — 44,53 —-
      if [ ! -d “$QT_S60_DIR” ]; then
      mv $TEMP/\$OUTDIR/bin $QT_S60_DIR
      # Various fixes for Linux support
      + ./dos2unix $QT_S60_DIR/bin/syncqt
      + ./dos2unix $QT_S60_DIR/mkspecs/common/symbian/symbian.conf
      + ./dos2unix $QT_S60_DIR/qmake/generators/symbian/symmake_abld.cpp
      + ./dos2unix $QT_S60_DIR/src/s60main/qts60mainappui.cpp
      patch -p1 -d $QT_S60_DIR < qt-s60-fixes.patch
      # Fixes for S60 3.0
      # TODO: S60 3.0 not supported yet

      Now it fails soon after with:

      Preparing build tree…

      The specified system/compiler port is not complete:


      Please contact

      Removing temporary files…

      • lizardo says:

        @grego: forgot to mention that I only tested these instructions on x86 32 bits. It may require changes for x86-64 support, only not sure what :(. If you make it work for 64 bits, let me know the changes so I can update the instructions.

        Regarding the dos line endings, I was sure the patch applied correctly even with them (it worked on Ubuntu 8.04 x86 32 bits, at least). I’ll recheck and fix them.

  4. Pingback: Installing Qt for Symbian SDK 4.6.1 on Linux « Anderson Lizardo's Blog

  5. Michael Behman says:

    Thank you so much Lizardo for these instructions, I’m trying to use them but with S60 2.6 instead. I’m getting some weird error while making the project:

    $ make DEL_FILE=rm ABLD=abld release-gcce
    bldmake bldfiles
    BLDMAKE ERROR: ERROR: CPP executable not found in path
    BEGIN failed–compilation aborted at /home/michael/gnupoc/symbian-sdks/2.6/epoc32/tools// line 84.
    Compilation failed in require at /home/michael/gnupoc/symbian-sdks/2.6/epoc32/tools// line 21.
    BEGIN failed–compilation aborted at /home/michael/gnupoc/symbian-sdks/2.6/epoc32/tools// line 21.
    Compilation failed in require at /home/michael/gnupoc/symbian-sdks/2.6/epoc32/tools// line 49.

    make: *** [abld] Error 1

    I’m guessing the error is in the double slash used to locate the files ( “epoc32/tools//” ), you can see from this link that someone else that was using S60 5.0 had this error as well:

    Any ideas on how to fix it?

  6. lizardo says:

    As far as I know, S60 SDKs are not backward compatible, so if you build your package on the 3.1 SDK it will not run on your 2.6 based phone. But you are better off asking these questions on the symbian forums.

    Besides, the Qt binaries only work on 3.1 and newer phones (I tried once on o 3.0 phone and it didn’t work).

  7. arul says:

    i’m facing trouble in qt,that,while open project and when i save …what path should i give in linux platform

Comments are closed.