CeGCC
gcc版のWindowsCE用のクロスコンパイラのプロジェクトがあった。
CeGCC's web page
http://cegcc.sourceforge.net/
The CeGCC project implements cross-development tools for Windows CE (PocketPC).
ソースもあったので、MacOSXで試してみる。
% wget http://nchc.dl.sourceforge.net/sourceforge/cegcc/cegcc-0.50-src.tar.gz % tar zxf cegcc-0.50-src.tar.gz % cd cegcc-0.50-src/src % sh build-cegcc.sh % sh build-mingw32ce.sh
パスを追加してコンパイルをしてみる。
arm-wince-cegcc-gccは、unixエミュレーション用のcegcc.dllにリンクするものを、
arm-wince-mingw32ce-gccは、win32ネイティブのものをビルドする
% PATH=/opt/cegcc/bin:/opt/mingw32ce/bin:$PATH % arm-wince-mingw32ce-gcc hello.c % file a.exe a.exe: MS-DOS executable PE for MS Windows 32-bit % file /opt/cegcc/bin/arm-wince-mingw32ce-gcc /opt/cegcc/bin/arm-wince-cegcc-gcc: Mach-O executable i386
実機に転送して実行。動いた。
サンプルにつかったhello.c
#include <windows.h> int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow){ MessageBoxW(0, L"こんにちは!", L"こんにちは!", 0); }