Windows CE (HPC/PocketPC)

WinAmp-like mp3 player - Poemi - for HPC/PocketPC

Now under development....

mp3, MOD, etc... plug-ins are available:)

Tips: using gcc for hpcmips on UNIX

2002/4/10: revised

binutils 2.11.2 (assembler, linker, etc...)

$ tar zxvf .../binutils-2.11.2.tar.gz
$ cd binutils-2.11.2
$ mkdir build
$ cd build
$ ../configure --prefix=/usr/local/wince --target=mips-pe
$ make
$ sudo make install

If you want to install to another path, you shold change prefix parameter so that you like.

gcc 3.0.4 (C/C++ compiler)

$ tar zxvf .../gcc-core-3.0.4.tar.gz
$ tar zxvf .../gcc-g++-3.0.4.tar.gz
$ cd gcc-3.0.4
$ mkdir build
$ cd build
$ ../configure --prefix=/usr/local/wince --target=mips-pe --with-gnu-as
$ patch < .../gcc_Makefile.diff
$ make
$ sudo make install
$ cd /usr/local/wince/lib/gcc-lib/mips-pe/3.0.4
$ patch < .../specs.diff

I made a patch file for specs. it fix followings.

So if you installed another path you should fix this spec file or use -L flags on linking.

gcc_Makefile.diff is also needed for building libgcc.a as little-endian binary. Unless this patch, libgcc.a may be for big endian.

w32api 1.2 (include files)

$ tar zxvf w32api-1.2.tar.gz
$ cp -rf include/* /usr/local/wince/include/
$ rm -rf include lib
$ cd /usr/local/wince/include
$ patch -p1 < .../w32api-1.2-hpcmips.diff
$ tar zxvf < .../include.tar.gz

HPC30SDK (library files)

$ mdkir /usr/local/wince/lib/hpcpro
$ cp -rf .../HPC30SDK/Lib/* /usr/local/wince/lib/hpcpro
$ cd /usr/local/wince/lib/hpcpro/mips
$ for f in *.lib; do mv $f lib${f/.lib/.a}; done

You can get SDKs for CE from Microsoft's website freely.

other setup

$ export PATH="/usr/local/wince/bin:$PATH"

If you use only this cross compiler, add "/usr/local/wince/mips-pe/bin" too. With it you type just gcc instead of mips-pe-gcc.

test

/* test.c */
#include <windows.h>

int WINAPI WinMain
(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, L"compiled by gcc 3.0.4", L"TEST", MB_OK);
    return 0;
}
$ mips-pe-gcc -o test.exe test.c -lcoredll

building DLL

; test.def
EXPORTS
    FooFunc @1
    BarFunc
$ mips-pe-gcc -shared -e _DllMainCRTStartup -o test.dll test.def foo.o bar.o -lcoredll

using C++

Using C++, you may get error "undefined reference to '__gxx_personality_v0'" on link phase. You can avoid from this error with -fno-exceptions flag. But in this way, you can not use any exceptions, You know.

$Id: index.html,v 1.4 2002/04/09 19:35:57 toyoshim Exp $