QtCreator
From Openmoko
Simarillion (Talk | contribs) (→Custom Project) |
Simarillion (Talk | contribs) |
||
Line 155: | Line 155: | ||
ssh root@192.168.0.202 | ssh root@192.168.0.202 | ||
*works | *works | ||
− | *The best is using public | + | *The best is using public key authentication that you were not asked for the password |
Revision as of 01:17, 17 April 2009
WARNING: This tutorial is still Alpha Do it at your own risk |
NOTE:
As long as there are no Qt 4.5 sources for arm this doesn't work on K/Ubuntu/Jaunty I will upload Openmokoder to svn soon that scripts can be extended Feel free to add Information for other Distributions |
Contents |
Introduction
I created a project called "OpenMokoder" which should help to develop Qt4 projects for freerunner. You only need to copy your sourcecode or use the included sample project run the script and you can easy compile, debug, crosscompile, package your project with Trolltechs QtCreator. QtCreator is a very good lightweight Qt IDE with features like embedded Qt Designer, Code completion, debugging, svn, ...
Note: This tutorial is tested with SHR and FSO The installation process is based on Kubuntu 9.04 (Jaunty)
1. install Toolchain
First of all you have to install the toolchain. If you have already done this skip this step. I will just give a summary of how to do that for copy paste the detailed information can be found at Toolchain
sudo apt-get install gcc g++ autoconf automake binutils libtool libglib2.0-dev ccache libxrender-dev intltool libmokoui2-dev libgconf2-dev mtools fakeroot alien check ubootmkimage libcurl3 libqt4-dev
Unfortunately the libtool since Ubuntu(intrepid) doesnt't work with the toolchain so you have to install the one from Ubuntu(Hardy)
- deinstall libtool from intrepid/jaunty
sudo apt-get remove libtool
- download libtool from hardy (http://packages.ubuntu.com/de/hardy/libtool)
wget http://ftp.sjtu.edu.cn/ubuntu/pool/main/libt/libtool/libtool_1.5.26-1ubuntu1_i386.deb
or
wget http://ftp.sjtu.edu.cn/ubuntu/pool/main/libt/libtool/libtool_1.5.26-1ubuntu1_amd64.deb
- and install it
sudo dpkg -i libtool_1.5.26-1ubuntu1_i386.deb
- build a debian package and install it
mkdir ~/sources cd ~/sources wget http://downloads.openmoko.org/developer/toolchains/openmoko-i686-20090323-armv4t-linux-gnueabi-toolchain-openmoko.tar.bz2 cd / sudo tar -xjvf ~/sources/openmoko-i686-20090323-armv4t-linux-gnueabi-toolchain-openmoko.tar.bz2 cd ~/sources/ bunzip2 openmoko-i686-20090323-armv4t-linux-gnueabi-toolchain-openmoko.tar.bz2 gzip openmoko-i686-20090323-armv4t-linux-gnueabi-toolchain-openmoko.tar fakeroot alien -d openmoko-i686-20090323-armv4t-linux-gnueabi-toolchain-openmoko.tar.gz sudo dpkg -i openmoko-i686_20090323-2_all.deb
- Change permissions of toolchain that scripts don't need root rights. REPLACE <your-name> (in general with your username)
sudo chown -R <your-name>.<your-name> /usr/local/openmoko/arm
2. Configure Toolchain
- Install important packages in toolchain
. /usr/local/openmoko/arm/bin/setup-env opkg-target update opkg-target install libpng12-0 libpng12-dev libgcc1 libglib-2.0-0 libgmodule-2.0-0 libgobject-2.0-0 libgthread-2.0-0 libpng-dev libpng3 libxrender-dev libxrender1 libxrandr-dev libxrandr2 libfontconfig-dev libfontconfig1
- Add angstrom Repo and QT4 libs to toolchain
echo arch base 50 >> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf echo src/gz base http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base >> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf opkg-target update
opkg-target install libgcc1 libglib-2.0-0 libgmodule-2.0-0 libgobject-2.0-0 libgthread-2.0-0 libpng12-0 libqt3support4 libqtassistantclient4 libqtclucene4 libqtcore4 libqtdbus4 libqtdesigner4 libqtdesignercomponents4 libqtgui4 libqthelp4 libqtnetwork4 libqtscript4 libqtsql4 libqtsvg4 libqttest4 libqtxml4 libstdc++6 qt4-assistant qt4-common qt4-dbus qt4-demos qt4-designer qt4-fonts qt4-linguist qt4-pixeltool
- ignore the error "Cannot satisfy the following dependencies for qt4-common ..."
- install with force depends
opkg-target -force-depends install http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtcore4_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtcore-dev_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtdbus4_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtdbus-dev_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtgui4_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtgui-dev_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtnetwork4_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtnetwork-dev_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtxml-dev_4.4.3-r4.1_armv4t.ipk http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv4t/base/libqtxml4_4.4.3-r4.1_armv4t.ipk
- If not done yet install qt sources on Host
sudo apt-get install libqt4-dev
3. install QTCreator
- download binary from:
http://www.qtsoftware.com/downloads/
- easy install via:
chmod +x qt-creator-linux-x86-opensource-1.0.0.bin sudo ./qt-creator-linux-x86-opensource-1.0.0.bin
4. OpenMokoder
- OpenMokoder is just a set of folders that contain some scripts, templates and the sample project.
- Download Files
https://projects.openmoko.org/frs/?group_id=271
- Extract to a destination of your choice for example
tar xfvz Openmokoder.tar.gz
- Make all scripts executable
cd Openmokoder/scripts/ chmod +x *.script cd .. chmod +x *.script
- If your Freerunner has another Ip than 192.168.0.202 please change it in copy.script start.script packaging.script in the scripts folder
- For the first try I would recommend to use the included sample project
- Run Script
cd Openmokoder ./CreateProject.script sampleproject
WARNING: Here I have the problem that my host with KUBUNTU/JAUNTY is running Qt 4.5 and I get the following error |
"This file was generated using the moc from 4.5.0. It" "cannot be used with the include files from this version of Qt." "(The moc has changed too much.)"
- But with intrepid it should work
- Now switch to Folder /Openmokoder/sampleproject/QtCreator and open the file SampleProject.pro with QtCreator for example by doubleklick
- If you click on "Projects" on the left of QtCreator U should see something like this
- You can see the 3 customized build options
- Host: Builds the sample project on the host
- Freerunner: Crosscompiles the sample project and scp to freerunner /usr/bin/
- Packaging: Packages the sample project and installs the package on the freerunner
Crosscompiling
- Connect your freerunner to your Computer (if necessary use: sudo /etc/init.d/networking/restart)
- Choose "Freerunner" as Build Settings and start compiling with ctrl+b
- You can watch the build process if you chose "Compile Output" at the bottom right
- Once the build process is finished the test program should start on the freerunner
Packaging
- Now choose "Packaging" as Build Settings and hit ctrl+b again
- Afterwards the package should be installed on your Freerunner
- You should have a new Icon on the Freerunner Desktop
- The different build steps can be turned on and off
- The BuildStep "Freerunner Autotools" is only needed at the first time or when you add a new file and can afterwards be deactivated then the build process is much faster
NOTE:
The binary for the Freerunner can be found in /Openmokoder/sampleproject/src The Host binary can be found in /Openmokoder/sampleproject/QtCreator |
Custom Project
If you want to compile your own project just put your Project (It must contain a .pro Poject File) into /Openmokoder/src/ and start
./CreateProject.script projectname
Because the projectname you enter here will also be used for packaging it has to be without capital letters Afterwards continue like with the SampleProject
Issues
SSH
- You should be able to connect to your freerunner via SSH else some scripts do not work properly
- Try if
ssh root@192.168.0.202
- works
- The best is using public key authentication that you were not asked for the password