Contents

Basic tools

MinGw

Install mingw for linux

On debian the packages are called mingw32, mingw32-binutils, mingw32-runtime, you need to install mingw32 with gcc/g++ 3 and not 4 since that doesn't work with kdelibs, debian testing/unstable has gcc 4 so i've installed mingw32 package from ubuntu repository.

On gentoo, you need to do the following: "emerge crossdev; crossdev mingw32".

Qt4 Kdesupport and dependencies

You can install these dependencies(aspell, boost, dbus, qca etc..) from windows with the kdewin installer or manually download them from sourceforge mirrors

Qt4 and KDE4 for linux

You also need to have Qt4 and KDE4 already installed on linux, to use moc/uic/kde4automoc etc...

Cmake

To cross compile KDE you need CMake >= 2.5, you can get the last version from CVS

Create two files Toolchain-mingw32.cmake and mingw32-kdelibs.cmake with this contents and place them somewhere i.e. in your home

Build kdelibs

you have to make a link to your kde4automoc and kconfig_compiler for linux in the bin directory

ln -s /path/to/kde4automoc bin/
ln -s /path/to/kconfig_compiler bin/

since linux is case sensitive you have to make symbolic links for some headers

cd /windows/kde4/include
ln -s soprano Soprano

You will get an error in klauncher.moc about slotKDEInitData so go into kinit and do something like this(you need wine)

rm *.moc
../bin/kde4automoc.exe /home/kdeuser/kde/src/KDE/kdelibs/build/kinit/klauncher_automoc.cpp /home/kdeuser/kde/src/KDE/kdelibs/kinit /home/kdeuser/kde/src/KDE/kdelibs/build/kinit /windows/kde4/bin/moc.exe
and then do make as usual

Another error in kdewidgets because wine doesn't find some dll to run makekdewidgets.exe so either run the linux version manually like this