Qt 4.7.0 for Symbian on Linux (now with Qt Creator support!) October 11, 2010
Posted by lizardo in Linux.Tags: Linux, qt, S60, symbian
trackback
It’s been some time since my last update on the Qt for Symbian Linux installer. My colleague Bruno Abinader did a great job in the meantime, by releasing his own modified “all-in-one” script that installed gnupoc, Qt, Qt Mobility and Smart Installer
.
From now on, I’ll follow Bruno’s idea and provide a single script that installs everything you need for Qt for Symbian development on Linux. This version will install just gnupoc and Qt, but next ones should support Qt Mobility and Smart Installer as well. I also temporarily disabled support for S60 3.1 SDK, so for now there is only S60 5.0 SDK support.
Some of you might have noticed that the official Qt 4.7.0 documentation has some experimental installation instructions for Linux. Unfortunately, it requires compiling Qt from sources, which might take long time and currently requires the non-free ARM RVCT compiler. The instructions on this post are my attempt on creating a usable setup in a user-friendly way.
So, enough explanations, let’s go to the instructions!
Preparation
Download all required files to a single directory (e.g. “~/downloads”):
- gnu-csl-arm-2005Q1C-arm-none-symbianelf-i686-pc-linux-gnu.tar.bz2 (11MB): CodeSourcery’s ARM toolchain for Symbian
- gnupoc-package-1.17.tar.gz (8.6 MB): tools and patches to run Symbian SDK on Linux
- qt-symbian-opensource-4.7.0-s60.exe (262 MB): Qt for Open Source C++ development on Symbian
- S60_5th_Edition_SDK_v1_0_en.zip (622MB): S60 SDK for Symbian OS (click on the “Download S60 and Symbian SDKs” button)
- s60_open_c_cpp_plug_in_v1_7_en.zip (31 MB): Open C/C++ Plug-ins (under “Plug-ins for the Symbian SDKs” section)
- qt_for_symbian_4.7.0_linux_installer_v4.sh: Unofficial Qt for Symbian installer for Linux
For building the native tools from gnupoc, you will need:
- the GCC C/C++ compilers
- development files for zlib
- development files for openssl
On Ubuntu, you can install these using the following command:
sudo apt-get install build-essential zlib1g-dev libssl-dev
Installation
Install everything using a single command:
./qt_for_symbian_4.7.0_linux_installer_v4.sh \
<download-dir> \
<install-dir>
Replace <download-dir> with the location of all files downloaded in previous section (e.g. “~/downloads”), and <install-dir> with the destination directory (e.g. “~/gnupoc”). Note that both directories must have absolute paths.
If installation was successful, you should see the message “Installation has finished!” followed by some instructions. Follow those to setup Qt Creator and/or command line.
Device setup
Install Qt on the phone, by copying and installing the <install-dir>/qt_4.7.0/qt_installer.sis package. This single SIS file has all necessary dependencies for running Qt applications.
Additionally, if you plan to use Qt Creator, I suggest installing s60_5_0_app_trk_3_2_7.sisx. It will allow quickly testing your application directly on the device through bluetooth. Also make sure your desktop and phone are paired, then run these commands:
sdptool browse local | grep -q "Service Name: Serial Port" \
|| sdptool add SP
sudo rfcomm listen rfcomm0
The first command makes sure the Serial Port service is only added once, and the second one creates the /dev/rfcomm0 device. You should see output like:
Serial Port service registered
Waiting for connection on channel 1
On the phone, open App TRK (It should be under the “RnD Tools” directory). It will show “Status: Not connected”. Go to Options -> Settings, and make sure “Connection” is set to “Bluetooth”. Next, go to Options -> Connect and select your desktop from the Bluetooth devices shown. On the phone, you should see:
Status: Connected
BT Dev Name: <your_computer_name>
BT Port number: 1
While on your desktop console:
...
Connection from XX:XX:XX:XX:XX:XX to /dev/rfcomm0
Press CTRL-C for hangup
Now, when you click “Run” on Qt Creator, you should see something like this on its “Console Window”:
Executable file: /home/lizardo/gnupoc/sdk_5.0/epoc32/release/$(PLATFORM)/$(TARGET)/animatedtiles.exe
Package: 117288 2010-10-11T11:43:23 /home/lizardo/NokiaQtSDK/Examples/4.6/animation/animatedtiles/animatedtiles.sis
Deploying application to 'Bluetooth device (/dev/rfcomm0)'...
Copying installation file...
Installing application...
Starting application...
Application running with pid 1134.
And the application should install and open directly on your phone
Enjoy!
Hey!
Waited a long time to see something new on this topic from you
Looks nice, but I didnt try it yet.
I think Qt 4.7.0 for Symbian isnt really necessary by now.
As far as I know Ovi Store by Nokia doesnt support Qt 4.7.0 at the moment as well as the smart installer doesnt support it too.
Therefore I still use Qt 4.6.3 til this will change.
Or am I wrong?
Regards
Wolfgang
I heard Smart installer does not support it yet. I believe it is just a matter of time. As Bruno mentioned, N8 seems to come with Qt 4.7 pre-installed, so it would be very strange one could not use it in Ovi Store…
Do you have any links about this missing Qt 4.7 support?
PS: for 4.6.3 + smart installer setup, I suggest Bruno’s modified script: http://cabledogs.org/abinader/2010/08/18/updated-unofficial-qt-for-symbian-4-6-3-all-in-one-linux-installer-script/
I don’t know about Qt Creator support for it though (I had to make a few fixes to gnupoc and qmake to make it work nicely), but if you are really interested, you can check my modifications on the “install.sh” and the qmake-4.7.0.patch on the installation script, and try to make similar changes for 4.6.3. The unpack instructions from http://lizardo.wordpress.com/2010/01/21/installing-qt-for-symbian-sdk-4-6-1-on-linux/#comment-93 still apply.
Regards,
“Please note that the announced Symbian^3 based smartphones (like Nokia N8) have Qt 4.6 preinstalled but they do not include Qt Mobility, so the current requirement is to use the Smart Installer wrapper even for applications targeting Symbian^3 devices.”
http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian
As well as the clarification in forum nokia.
“To summarize:
* Use Qt 4.6.3 and smart installer to make commercial apps for Symbian
* Treat current 4.7 release as a technology preview that you can use the study the new great technologies it provides like Qt Quick. We will later on provide a Qt 4.7 package for S^3 devices like N8 for you to try out 4.7.”
http://discussion.forum.nokia.com/forum/showthread.php?210094-Clarification-on-Qt-4.7-for-Symbian-and-application-distribution-to-Ovi-store
Im sure Qt 4.7 will be supported in the future, but at the moment it sounds very much like it could still take some time.
Thanks for your suggestion. I installed Qt 4.6.3 with scripts from http://martin.st/symbian/.
It supports Qt 4.6 as well as 4.7 but not in one installer script
Qt Creator support would be fine, but didnt try it yet – i like to use eclipse
Regards
Hi Wolfgang, altough Qt 4.6.3 is now present in a large scale of Symbian devices, the most recent Nokia devices such as the N8 already comes with Qt 4.7 embedded on it, so it’s a good idea to start thinking about an upgrade
Sorry didnt see your comment
Please look at my answer above.
Do you have any sources which state Qt 4.7 is already supported?
e.g. Nokia N8 is already shipped in Germany and the links I posted above arent very old.
So I dont know what to think.
I had Qt 4.7 installed, but after i noticed these statements I downgraded to 4.6 for actual development.
Hi Wolfgang,
Thanks for your comments. It’s unfortunate that N8 does not come with 4.7 pre-installed. As you noticed, gnupoc supports 4.6 as well, so I’ll see about adding support for it as well on my installer.
Regards,
I tried to install it, and everythin seemed to go OK, but now i only have .exe’s in ~gnupoc/qt_4.7/bin (that means that i’m missing qmake, moc, rcc et al.)
I followed the steps on this blog. Did I do something weird or is there a bug in the script?
Anyways, thank you for your great work
The qmake build is done by gnupoc. Can you get a full installation log (e.g. ./qt_for_symbian_4.7.0_linux_installer_v4.sh … > /tmp/install.log) and put it somewhere so I can take a look? Thanks for testing!
Correction: use “&>” instead of just “>” so we can get the error messages as well.
I uploaded the install log here: http://www.mediafire.com/file/q7ljw066h4fdyjy/install.log
It’s 8,7 Mb… heavier than the gnupoc package xD
With the reinstall I didn’t get the native qt tools, either.
From your install log, I can see the problem now:
+ [ /home/ssorgatem/gnupoc//qt_4.7.0 != ]
+ ./mergedir qt_temp/$OUTDIR/bin /home/ssorgatem/gnupoc//qt_4.7.0
+ rm -rf qt_temp
+ set +x
[: 83: 1: unexpected operator
For some reason, your /bin/sh did not recognize this line from gnupoc-package-1.17/sdks/install_qt_4.7.0:
if [ "$QTDEST" != "" ]; then ./mergedir qt_temp/\$OUTDIR/bin $QTDEST; fi
Can you check whether /bin/sh is a symlink, and if so, to which shell it is pointing to? And if it is not pointing to /bin/bash, try changing to it.
Generally, you can do so by “ln -sf /bin/bash /bin/sh” (make sure /bin/bash exists).
Let me know if it fixes the problem!
Regards,
In effect, /bin/sh points to /bin/dash.
So it seems it’s a bug somewhere (in dash or in gnupoc-package-1.17/sdks/install_qt_4.7.0). Maybe the script should call /bin/bash instead of /bin/sh to avoid it
With bash it works now
Thank you for your work
Hi,
I actually have the same problem as you ssorgatem, let me know how did you resolve it, did you recompile all? after making changement of the call of /bin/sh to /bin/bash??
Thank you
yep, all (that is, running the install script)
I also removed manually the previous incomplete install before running it.
Hi!
After I read in the comments about the dash vs. bash thing, I was able to install everything without a problem.
Thank you very much!
Hi!
First, thanks for this very usefull script.
Then, could you set the shell to bash as default to avoid all the dash/bash problems in the future?
Regards
Hi!
What should I do if I want to use QtMobility in linux?
Thanks in advance
Get qt-mobility-symbian-opensource-1.1.0.zip, unzip it, see INSTALL.symbian for installation instructions. I had to comment out “contains(QT_CONFIG, opengl): QT += opengl” from gnupoc/qt_4.7.0/mkspecs/features/mobility.prf. Works fine.
A 4.6.3 + smartinstaller script would be nice. Got the 4.7 installed, but N8 doesn’t like the binary built from it. Thanks and looking forward to 4.6.3 installer.
While the next version of my installer script does not come, you can always install gnupoc manually and use it to install 4.6.3 + smartinstaller:
http://www.martin.st/symbian/
My installer is just a wrapper script around gnupoc that makes the installation more automatic and adds a few changes to allow integration with Qt Creator.
I set up Qt4.7.1, QtMobility1.1.0 and QtCreator2.1.0beta2 using the latest gnupoc package from git.
The problem I’m having has to do with the bluetooth QtCreator setup.
Using the following works fine with Ubuntu, but I would like for QtCreator to do the listening part.
sdptool add SP
sudo rfcomm listen rfcomm0
Strangely enough there is no rfcomm0 device node under /dev.
When I run QtCreator as root (sudo ./qtcreator) there is no need for “sudo rfcomm listen rfcomm0″ and I even get the device information (CPU: v4.0 ARM 920T, little endian, App TRK: v3.2 TRK-Protokoll: v3.6). Even though there also is no /dev/rfcomm0.
I tried the following.
sudo mknod /dev/rfcomm0 c 216 0
sudo chown : /dev/rfcomm0
Now root privileges should no be required to access /dev/rfcomm0 but for some reason QtCreator still cannot connect. The dialog “Waiting for bluetooth connection” never goes away.
Do you have an idea on how to get this to work without having to run QtCreator as root.
Thanks
After trying many different things
echo “sdptool add SP” >> ~/.profile
sudo chmod +s /usr/bin/rfcomm
makes it possible.
Under Projects > Targets > Run it is neccessary to hit the refresh button next to “Device on serial port: Bluetooth device (/dev/rfcomm0)” once.
Otherwise QtCreator waits for the device connection indefinitely.
‘If installation was successful, you should see the message “Installation has finished!” followed by some instructions. Follow those to setup Qt Creator and/or command line.’
But, when the operation was complete, my terminal did a bit strange (gnome-terminal) and I only had the last part of the instructions.
Can someone tell me where to find those instructions? I didn’t find them in the install script. fgrep for some of the words that I had on the install directory, had no succes (didn’t find anything)
Just execute:
./qt_for_symbian_4.7.0_linux_installer_v4.sh –keep –noexec –target qt_for_symbian
You will then find install.sh in the just created qt_for_symbian folder.
Thanks!
I only had to replace the single dashes (-) with two dashes(–)
I got error that ‘Basic XLib functionality test failed!’. Installing libxext-dev package solved the problem for me (Ubuntu 10.10)
Hi Lizardo,
Thanks for this great job,
now i can compile with qt 4.7.0 and mobility 1.1.0,
compilation ok!!!
Now the problem: the generated sis file can’t install on symbian device, the installer don’t prompt for autorization (capabilities) and fail.
With remote compiler i see a patch step with “elftran” about capabilities.
Do you have any idea on how to add this step in the generation of the sis file?
Regards
Hi Lizardo,
cfaure, I got the same error when I was trying to install the camera example that comes qt-mobility.
I’m also having problems with deployment of my qml files:
“$ make debug-gcce”
… //A lot of lines that seems the correct building step//…
“…
Deploying changed files…
/bin/sh: Syntax error: Unterminated quoted string
/bin/sh: Syntax error: Unterminated quoted string
…”
Taking a look at the generated Makefile I found out some backslashes in the path of some files. Replacing for the normal slashes didn’t solve the problem: error messages are gone, i can install my app, but i can’t loading the qml files. So the deployment didn’t happen yet.
Any clues?
Regards
If I understood all this properly, the script and this guide is about deploying for Symbian^1. What about Symbian^3? The gnupoc-package changelog tells that it was included in gnupoc 1.18, but this script still uses version 1.17.
A guide for absolute newbies developing Qt apps for Symbian^3 would be SUPERB..
First off, thanks a lot for this guide.
I’ve followed the instructions in the GNUPOC README and gotten build system ready for Symbian targets using bldmake, abld etc. I’ve also installed Nokia Qt SDK 1.0.2 which includes Qt 4.7.0 I guess.
Could you tell me how exactly you patched qmake to add extra targets, and how you integrated this with Qt Creator? I tried comprehending your install script but it’s designed for a different version of the Symbian S60 SDK, and it also isn’t designed to work with the Nokia Qt SDK.
[Ubuntu 10.10 32bit, Nokia Qt SDK 1.0.2, Qt 4.7.0, Symbian S60 3rd FP1 SDK, GNUPOC 1.19]
Thanks.
Hi,
Sorry about the late response. My script should work just fine with Nokia Qt SDK (I actually use it). The only difference I see is that you use the Symbian S60 3.1 SDK, which I never used.
You can check the installation script in http://pastebin.com/R2NhNvvH (this is from v4). You can also extract the installation script contents by running:
./qt_for_symbian_4.7.0_linux_installer_v4.sh --noexec --keep --target /tmp/tmp_dirAnd checking the contents of the /tmp/tmp_dir directory (install.sh is the installation script).
Hope that helps,
Thanks, I’ll give it another try.
Excellent job! Thank you!