CeGCC cross compiler for PocketPC

Installation of a binary release of CeGCC for Linux

The CeGCC Linux distributions are binary-only, and packaged as RPMs.

The sources of CeGCC are also available, but they're big. We believe that those who want to build from source are probably the same people who will want to keep up to date, so they will not mind accessing our SVN source repository.

Also, earlier (pre-)releases of CeGCC for Linux were packaged in another way. They're ancient, we recommend not using them any more.

What's in the RPM ?

The bottom line : the RPM contains all the tools you need to cross-develop applications.

The detail : it contains a set of executables, include files, and libraries that can be used on a Linux PC (Intel architecture) to build applications that'll run on a Windows CE platform with an ARM processor. In my case, the Linux platform is Mandriva 2006.0, the PC is a no brand Pentium IV (assembled it myself), and the PDA is a Mio 168 running Windows CE 4.20.0. The Mio's processor is an Intel PXA 255 (that's an Xscale, which is one of the large family of ARM processors).

Feedback

Feedback about this software should be sent to the CeGCC mailing list at cegcc-devel@lists.sourceforge.net. Questions, bug reports, .. should be addressed to that same address.

Installing the RPM

You can install the CeGCC RPM just like any other one, by using the

	rpm -i cegcc-cegcc-0.15-1.i586.rpm
	rpm -i cegcc-mingw32ce-0.15-1.i586.rpm
command. You'll need to be the superuser (root) for this to work. For unknown reasons, the RPM sometimes asks for the libiconv to be installed first. A workaround is to use the --nodeps option :
	rpm -i --nodeps cegcc-cegcc-0.15-1.i586.rpm

After a successful installation, all of CeGCC can be found under the /opt/cegcc and /opt/mingw32ce directory trees.

Help : /opt is a bad place on my system

Some people have insufficient free space on /opt, or /opt is not the place where they want this software to be. There are two ways around this.
  1. Tell RPM to install in another place
    rpm -i --relocate /opt=/home/cegcc-opt cegcc-cegcc-0.15-1.i586.rpm
    	
  2. You can put rpm on quicksand, by pointing /opt to another place
    # mkdir /home/cegcc-opt
    # ln -s /home/cegcc-opt /opt
    	

How do you use the release ?

To start using CeGCC, you'll have to put the directories /opt/cegcc/bin and/or /opt/mingw32ce/bin in your path, e.g. like this :

	export PATH=$PATH:/opt/cegcc/bin:/opt/mingw32ce/bin

To make this permanent, you'll want to apply such a change to your login environment, e.g. in the file $HOME/.bashrc .

Then, you can test the compiler by trying to compile fibo.c :

	#include <windows.h>
	#include <stdio.h>
	#include <stdlib.h>

	#define	FN	"/storage card/devel/fibo.txt"

	int fibo(int n)
	{
		if (n < 3)
			return 1;
		return fibo(n-1) + fibo(n-2);
	}

	int APIENTRY WinMain(HINSTANCE a,HINSTANCE b,LPWSTR c,int d)
	{
		FILE	*f;
		int	i, r;

		f = fopen(FN, "w");

		for (i=1; i<20; i++) {
			r = fibo(i);
			fprintf(f, "fibo(%d) = %d\r\n", i, r);
		}
		fclose(f);
	}

You may want to change the path where the program writes its output file in case you don't have that directory structure on your PDA.

Compile the source by using either of these commands :


	arm-wince-cegcc-gcc -o f.exe fibo.c
	arm-wince-cegcc-gcc -g -o fibo.exe fibo.c
On my system, this produces this warning message :

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

That's a side effect of linking against our cegcc DLL. The command successfully creates an executable file f.exe which can be transferred and run on a Windows CE system. You can download my version of f.exe or fibo.exe for comparison. The latter is significantly larger because of the debugging information included in the file (consequence of using the -g option).

Known problems

None that we care to mention here.

Information

Support

Powered by Sourceforge.net