Setup of Qt Embeded on the Zaurus ---------------------------------- by Jim Murff March 24, 2002 (ver 1.1) =========== 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: /mnt/cf/bin /mnt/cf/lib /mnt/cf/include - Environment variable QTDIR == /home/QtPallmtop ========= 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 .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. ln -s /mnt/cf/bin/moc $QTDIR/bin/moc 4) This fools moc which is looking for this stdc lib of this name in $QTDIR. ln -s /mnt/cf/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 mv /mnt/cf/temp/usr/include/* /mnt/cf/include # gets all optional header files 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. ===================== What compiled so far: ===================== - t1 - t3 tutorials no changes to Makefile.. (moc does not run) - t4 - t6 tutorials added QT_NO_DRAGANDDROPP to Makefile. (moc does not run) - t7 - t8 tutorials added QT_NO_DRAGANDDROPP and QT_NO_PROPERTIES to Makefile. (moc does run). [t8 is too big for screen but it runs fine] - tictac example removed ../../.h deppendencies & added QT_NO_DRAGANDDROP and QT_NO_PROPERTIES to Makefile. (moc runs) - life example removed ../../.h depenndencies & added QT_NO_DRAGANDDROP and QT_NO_PROPERTIES to Makefile. (moc runs) Executable works best if use scale of 3 or 4. e.g. ./life -scale 4 =========== 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. * Some programs (like t9) won't compile or link due to issues with qpainter.h and QT_NO_TRANSFORMATIONS. If this is defined errors with 'no matching function call' happen and if it is not defined link errors occur because libqt has no such definition. Not sure what to do there. * 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 http://www.geocities.com/jmurff1