Projects/KDE on Windows/Windows CE

From KDE TechBase

Introduction

This page describes a work in progress, there are no KDE Applications running on Windows Mobile (thtat i know of). It is only intended to give a starting point to developers for cross compiliation and Windows CE related issues. Since Qt is already ported for Windows CE it should be possible to get some KDE Appliciations running on that Platform.

Building Qt with the MSVC-Compiler (Visual Studio)

Setting up Visual Studio

First thing you need is Visual Studio in the professional or standard edition, be aware that the express editions are not supported. ( You could use Microsoft Embedded VC which is cost-free depreciated and not supported by Qt )
Next thing you need is a Microsoft Windows Mobile Platform SDK corresponding to your target platform. Just search the Microsoft download pages or get the Windows Mobile 6 SDK from here
( You should take a loot at the System Requirements)
If everything is set up correctly you should now be able to create a “Visual C++ smart device" project in Visual Studio.


Building Qt

Download the Qt libraries for Windows CE from http://qt.nokia.com/downloads/win-ce-cpp and extract it, you may want to make sure that your path contains no blanks to avoid some problems.
Now you should add your <qtdir>\bin to your Windows PATH environment variable (which can be done from “Control Panel → System → Advanced →Environment variables” )

Next get up your Visual Studio Command Prompt which should be accessible from the Windows Start Menu. Change the working directory to your <qtdir> and start the configuration. There should be a configuration.exe in your <qtdir> with the usual lots of options, (configure.exe -help for more info) for cross compiling you need to give at least the -platform parameter with your host system and -xplatform with your cross-compile target. Supported platforms are listed in the README file. e.g.:

configure.exe -platform win32-msvc2008 -xplatform wincewm60standard-msvc2008


Now that your configuration is set you can start the cross compilation. To switch from your “normal” build environment to the wince target Qt has a nice script included in the /bin directory (which should be in your PATH) just try calling setcepaths and provide your target configuration.
setcepaths wincewm60standard-msvc2008
With nmake (Visual Studio version of make) you can now build Qt for your target system.


Building Qt for Windows CE using cegcc

The original mailing list thread:

http://lists.trolltech.com/pipermail/qt-wince-interest/2009-November/000764.html


Notes about the port: (by Maurice Kalinowski)

- Project page: http://cegcc.sourceforge.net/ - arm-mingw32ce is the compiler we are chosing, not cegcc - download link: http://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/mingw32ce-0.59.1.tar.bz2/download

Building Qt for Windows CE on Linux with mingw32ce Assume you have a checkount in <QTSRCDIR> - go to <QTSRCDIR> - call cegcc_configure

/* Building the host tools */ - foreach <item> in bootstrap, moc, uic, rcc

   - goto <QTSRCDIR>/src/tools/<item>
       - call qmake -spec <QTSRCDIR>/mkspecs/linux-g++
       - call make

/* Settings up a cross compiler */ - Something alike:

 export MINGWPATH=/opt/mingw32ce
 export INCLUDE=$MINGWPATH/arm-mingw32ce/include:$MINGWPATH/include:$INCLUDE
 export LIB=$MINGWPATH/arm-mingw32ce/lib:$MINGWPATH/lib:$LIB
 export PATH=$MINGWPATH/bin:$MINGWPATH/arm-mingw32ce/bin:$MINGWPATH/libexec/gcc/arm-mingw32ce/4.4.0:$PATH

- foreach <item> in winmain, corelib, gui

    - goto <QTSRCDIR>/src/<item>
        - call qmake again
        - call make
        - call make install

- in case of pch errors delete .pch/release-static-emb-windowsce/qt_gui_pch.h.gch directory - when you are compiling your application outside of the Qt tree, you might

 get into trouble related to mkspecs and include dirs.

- for deployment you need to copy these files also to the same directory on the device:

   libgcc_s_sjlj-1.dll
   libstdc++-6.dll
 which are located inside the arm-mingw32ce directory


Additional Notes:

Currently Windows Mobile >= 6.1 does not load the libgcc_s_sjlj-1.dll libstdc++-6.dll properly, fix is in the works, see:

http://www.mail-archive.com/[email protected]/msg02699.html



Packaging:

Deploying Qt Windows Mobile Applications using LCAB

LCAB is a free software utility, that has the ability to create Microsoft CAB archives. You can get it on ( http://packages.debian.org/lenny/lcab )or as a Debian package.

Now that you can create cabinet files, the question is how to get Windows Mobile to recognize them as install packages. Thanks to Shaun Jackman this, also is no Problem. He wrote a Perl script to add the needed manifest and setup configuration file. You can find it under ( http://files.intevation.de/incoming/aheinecke/cab_files/pocketpc-cab.pl ) There is also a pocketpc-cab Debian packet out there, which does not support registry entries or the creation of shortcuts.

This script needs a configuration file, like Cabwiz but it is much more simple then the Cabwiz variant. Simply write down for every file you want to package:

Filename Target-Directory [Shortcut Name] [Shortcut Folder] for example the Qt widget collidingmice: collidingmice.exe %CE1%/Colliding_Mice "Colliding Mice" %CE11% msvcr90.dll %CE2% QtCore4.dll %CE2% QtGui4.dll %CE2%

This installs collidingmice.exe to Program Files/Colliding_Mice , places a shortcut in the Start Menu folder and copies the libraries into the Windows directory. The CE vars are WindowsCE variables, for more on them see the Microsoft documentation.