QtOnTheZ.txt

From OESF

Revision as of 19:22, 22 June 2005 by Ken (Talk | contribs)
Jump to: navigation, search

Contents

Setup of Qt Embeded on the Zaurus

by Jim Murff March 23, 2002

BACKGROUND

I have been trying for a few weeks various things to get Qt to compile on the Zaurus. I was resigned to PyQt then I thought I'd give it one more try. Searching google for "Qt embedded" proved to be the thing that got me to the right resources. I found this: http://ftp.nl.debian.org/debian. It has everything you can ever imagine in debian package format which BusyBox on the Z happens to be able to unpack.

I was able to get qt-docs, qt-dev and support packages.The site has everything compiled already in many formats including ARM. Also it has lots of source.

Weirdly, using ARM compiled stuff, once I got everything in place it would compile fine but linker core-dumped right at the end of the link when it was close to dumping the executible. I thought i was done for. My goal was to minimally edit the Makefiles that came with the code so they would just work. But all the libraries listed were static. Then I realized - duh! - most of the libraries are already on the Z in dynamic format. So, I created links to them that the Makefiles were looking for (e.g. libqte.a -> to the libqte.so.x.x.x etc.) Then I added the two optional libraries listed in the makefiles (libpng, libmng)that were not on the Z -- And it worked!! The only other problem I found was on the more complicated tutorials and examples I needed some #defines. This required reading some of the header files.

I am not sure what I can legally distribute; so right now here are the just steps I took. I think a script would work fine for this but that's a later step.

My Zaurus

- Rom 1.11 - 128Mb SD card (fat16) - 512Mb CF card (fat16) - ZGCC installed on CF card.

Packages

1) http://ftp.nl.debian.org/debian/pool/main/q/qt-embedded/qt-embedded_2.3.2-2.dsc

 Readme like file. Gave me a clue what else QT needed. (libpng, libmng, libz, libjpeg)

2) http://ftp.nl.debian.org/debian/pool/main/q/qt-embedded/libqt-emb-dev_2.3.2-2_arm.deb

 The distrubution with all header files.

3) http://ftp.nl.debian.org/debian/pool/main/q/qt-embedded/qt-emb-doc_2.3.2-2_all.deb

 The docs(man & http), example code and tutorials.

4) ** http://ftp.nl.debian.org/debian/pool/main/z/zlib/zlib1g-dev_1.1.4-1_arm.deb

     http://ftp.nl.debian.org/debian/pool/main/libp/libpng/libpng2-dev_1.0.12-3_arm.deb
     http://ftp.nl.debian.org/debian/pool/main/libm/libmng/libmng-dev_1.0.3-3_arm.deb
  ** http://ftp.nl.debian.org/debian/pool/main/libj/libjpeg6b/libjpeg-progs_6b-5_arm.deb
   
  ** OPTIONAL I got all these files just to get/have the headers in case they are 
     needed later. And so linker could find libmng & libpng.


Steps

1) I used this command to unpack everything into a temporary directory

   on the CF card. 
           dpkg-deb -xX <filename>.deb  /mnt/cf/temp
   This puts everything in a tree /mnt/cf/temp/usr.

2) I moved all the Qt HTML files to my SD card where I store all my man pages

  (converted to HTML using man2html). 
  mv /mnt/cf/temp/usr/share/doc/html /mnt/card/html/qt-emed 

3) mv /mnt/cf/temp/usr/bin/moc /mnt/cf/bin # Where gcc lives.

4) This fools moc which is looking for this stdc lib of this name in

  $QTDIR (/home/QtPalmtop).
  
  ln -s /mnt/cf/lib/lib/libstdc++-3-libc6.1-2-2.10.0.so $QTDIR/libstdc++-libc6.2-2.so.3

5) cp /mnt/cf/bin/c++ /mnt/cf/bin/g++ # what Qt expects gcc to be called

6) mv /mnt/cf/temp/usr/include/qt /mnt/cf/include

7) ln -s /mnt/cf/include/qt $QTDIR/include

8) mv /mnt/cf/temp/usr/lib/* /mnt/cf/lib

9) Create all library links:

  > cd $QTDIR
  > ln -s libjpeg.so libjpeg.a
  > ln -s /mnt/cf/lib/libmng.a .
  > ln -s /mnt/cf/lib/libpng.a .
  > ln -s libqpe.so.1.5.0 libqpe.a  # just in case :)
  > ln -s libqte.so.2.3.2 libqte.a
  > ln -s libz.so libz.a

10) Only thing left was getting some DEFINES defined in the Makefiles.

   Had to add -DQT_NO_DRAGANDDROP & -DQT_NO_PROPERTIES to the SYSCONF_CXXFLAGS
  SYSCONF_CXXFLAGS= -pipe -DQWS -fno-exceptions -fno-rtti -O2 

-fno-default-inline -Wall -W -DQT_NO_DRAGANDDROP -DQT_NO_PROPERTIES

11) The example files have hardcoded paths to the includes. I had to remove these too.


FINAL NOTE

  • This is as far as I have gotten. Feedback is welcome.
  • I waste space on my cards because Fat16 doesn't support links. You can do better if you have ext2 formated cards.
  • I do get memory warnings when compiling, but I only have the konsole open and I ignore them and everything compiles and links fine.
  • If I compile only and then link seperatly it is happier less to no warnings. Also I tried without Qtopia running and it works well. Not even slow really.

Your Milage May Vary :)

-Enjoy Jim Murff jmurff@pacbell.net

Personal tools