Windows/Windows CE: Difference between revisions

From KDE Community Wiki
(Building Qt and Packaging Windows CE software)
 
No edit summary
Line 1: Line 1:
Building Qt for Windows CE using cegcc
== Introduction ==


The original mailing list thread:
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.  
http://lists.trolltech.com/pipermail/qt-wince-interest/2009-November/000764.html


== Building Qt with the MSVC-Compiler (Visual Studio)<br> ==


==== Setting up Visual Studio<br> ====


=== Notes about the port: (by Maurice Kalinowski) ===
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 [http://www.microsoft.com/downloads/details.aspx?FamilyId=1DACDB3D-50D1-41B2-A107-FA75AE960856&displaylang=en%20 Microsoft Embedded VC] which is cost-free depreciated and not supported by Qt ) <br>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 [http://www.microsoft.com/downloads/details.aspx?FamilyID=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en here<br>]( You should take a loot at the System Requirements)<br>If everything is set up correctly you should now be able to create a “Visual C++ smart device" project in Visual Studio.<br>


<br>


- Project page: http://cegcc.sourceforge.net/
==== Building Qt<br> ====
- 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
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.<br>Now you should add your &lt;qtdir&gt;\bin to your Windows PATH environment variable (which can be done from “''Control Panel → System → Advanced →Environment variables''” )
Assume you have a checkount in <QTSRCDIR>
- go to <QTSRCDIR>
- call cegcc_configure


/* Building the host tools */
Next get up your Visual Studio Command Prompt which should be accessible from the Windows Start Menu. Change the working directory to your &lt;qtdir&gt; and start the configuration. There should be a configuration.exe in your &lt;qtdir&gt; 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.:
- foreach <item> in bootstrap, moc, uic, rcc
 
     - goto <QTSRCDIR>/src/tools/<item>
configure.exe -platform win32-msvc2008 -xplatform wincewm60standard-msvc2008
         - call qmake -spec <QTSRCDIR>/mkspecs/linux-g++
 
 
 
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.<br>setcepaths wincewm60standard-msvc2008<br>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
 
<br>
 
==== 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 &lt;QTSRCDIR&gt; - go to &lt;QTSRCDIR&gt; - call cegcc_configure
 
/* Building the host tools */ - foreach &lt;item&gt; in bootstrap, moc, uic, rcc  
 
     - goto &lt;QTSRCDIR&gt;/src/tools/&lt;item&gt;
         - call qmake -spec &lt;QTSRCDIR&gt;/mkspecs/linux-g++
         - call make
         - call make


/* Settings up a cross compiler */
/* Settings up a cross compiler */ - Something alike:  
- Something alike:
 
   export MINGWPATH=/opt/mingw32ce
   export MINGWPATH=/opt/mingw32ce
   export INCLUDE=$MINGWPATH/arm-mingw32ce/include:$MINGWPATH/include:$INCLUDE
   export INCLUDE=$MINGWPATH/arm-mingw32ce/include:$MINGWPATH/include:$INCLUDE
Line 32: Line 54:
   export PATH=$MINGWPATH/bin:$MINGWPATH/arm-mingw32ce/bin:$MINGWPATH/libexec/gcc/arm-mingw32ce/4.4.0:$PATH
   export PATH=$MINGWPATH/bin:$MINGWPATH/arm-mingw32ce/bin:$MINGWPATH/libexec/gcc/arm-mingw32ce/4.4.0:$PATH


- foreach <item> in winmain, corelib, gui
- foreach &lt;item&gt; in winmain, corelib, gui  
     - goto <QTSRCDIR>/src/<item>
 
     - goto &lt;QTSRCDIR&gt;/src/&lt;item&gt;
         - call qmake again
         - call qmake again
         - call make
         - call make
         - call make install
         - call make install


- in case of pch errors delete .pch/release-static-emb-windowsce/qt_gui_pch.h.gch directory
- 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  
- when you are compiling your application outside of the Qt tree, you might
 
   get into trouble related to mkspecs and include dirs.
   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:
 
- for deployment you need to copy these files also to the same directory on the device:  
 
     libgcc_s_sjlj-1.dll
     libgcc_s_sjlj-1.dll
     libstdc++-6.dll
     libstdc++-6.dll
   which are located inside the arm-mingw32ce directory
   which are located inside the arm-mingw32ce directory


<br>


=== Additional Notes:  ===


=== Additional Notes: ===
Currently Windows Mobile &gt;= 6.1 does not load the libgcc_s_sjlj-1.dll libstdc++-6.dll properly, fix is in the works, see:  
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
 


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


<br>


<br>


==Packaging:==
== Packaging: ==


Deploying Qt Windows Mobile Applications using LCAB
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.
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.
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.
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:  
Simply write down for every file you want to package:


Filename Target-Directory [Shortcut Name] [Shortcut Folder]
Filename Target-Directory [Shortcut Name] [Shortcut Folder] for example the Qt widget collidingmice: collidingmice.exe&nbsp;%CE1%/Colliding_Mice "Colliding Mice"&nbsp;%CE11% msvcr90.dll&nbsp;%CE2% QtCore4.dll&nbsp;%CE2% QtGui4.dll&nbsp;%CE2%  
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.
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.

Revision as of 11:57, 8 December 2009

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.