Setting up the Windows CE cross compiler for linux: CeGCC

CeGCC Install from source:
Heavily influenced by the CeGCC's build tool chain documentaiton.

This guide is to get the unacquainted to get the sources to CeGCC, build and configure to generate ARM compatible Windows CE executables.

1. Get the sources: (Subversion client must be installed):

svn co cegcc

2. Run the build script and grab a coffee or what ever is appropriate:
sudo ./

3. Add the path to your bashrc settings:
export PATH=$PATH:/opt/cegcc/bin

4. Test the install with the following file and command:
#include <stdio.h>

int WinMain()

Compile line:

arm-wince-cegcc-gcc -o maintest.exe test.c

The only warning that should appear is:

Info: resolving _CRT_MT by linking to __imp__CRT_MT (auto-import)

If there are other errors please check the source file, the CeGCC mailing list, the forum on this or Wiki page.

NOTE: The cegcc carries the same syntax as gcc. For example -I for include directories -l for libraries to include.

5. Notes about CeGCC and SyncE: The CeGCC tool set was made to be used with the SynCE toolset. pcp to copy files to the connected PocketPC, and prun to remotely run an executable on the connected PocketPC device.
6. Sample make file (taken from the example make file provided from the sources (doc/examples/Makefile)

ARCH=        arm-wince-pe
CC=        ${ARCH}-gcc ${CFLAGS}
WINDRES=    ${ARCH}-windres

CFLAGS=        -D_WIN32_IE=0x0400 ${VERBOSE} ${INCLUDE}
LDFLAGS=    -Wl,--major-subsystem-version,4,--minor-subsystem-version,20
PDADIR=        ":/storage card/devel"

menu-resource.exe:    menu-resource.o menu-resource.rsc
    ${CC} -o $@ menu-resource.o menu-resource.rsc -lcommctrl ${LDFLAGS}

menu-resource.o:    menu-resource.c
    ${CC} -c $?

menu-resource.rsc:    menu-resource.rc menu-resource.h
    ${WINDRES} menu-resource.rc menu-resource.rsc

    -rm -f *.o *.exe *.rsc

    for i in *.exe ; do \
        pcp $$i ${PDADIR}/$$i ; \
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.