Frogger under Mono - Jonathan Pryor's web log
« Patenting Medical Facts | Main | Death to the Public Domain! »
Frogger under Mono
DotGNU Portable.NET provides a .NET Curses wrapper for creating nifty console-based programs using the ncurses library. It is possible to run this under Mono.
Alas, the provided configure script doesn't work very well with Mono, so we need to do things manually. The following will allow you to build Portable.NET's Curses.dll ncurses wrapper and run the bundled Frogger game.
- Download and extract pnetcurses:
$ wget http://www.southern-storm.com.au/download/pnetcurses-0.0.2.tar.gz $ tar xzf pnetcurses-0.0.2.tar.gz $ cd pnetcurses-0.0.2
- Build the libcsharpncurses.so helper library. You can ignore
the warnings produced by GCC.
$ cd help $ gcc -shared -o libcsharpncurses.so *.c -lncurses input.c: In function `CursesHelpGetNextChar': input.c:69: warning: integer constant is too large for "long" type $ cd ..
- Build the Curses.dll wrapper library:
$ cd src $ mcs -t:library *.cs -out:Curses.dll Compilation succeeded $ cd ..
- Create a Curses.dll.config file so that Mono can load the
appropriate native libraries. This file should go into the same directory
as Curses.dll.
$ cd src $ cat > Curses.dll.config <<EOF <configuration> <dllmap dll="cygncurses5.dll" target="libncurses.so"/> <dllmap dll="libcsharpcurses-0-0-1.dll" target="libcsharpncurses.so"/> </configuration> EOF $ cd ..
- Build the Frogger.exe demo program:
$ cd frogger $ cp ../src/Curses.dll* . $ mcs -t:exe -out:Frogger.exe -r:Curses.dll *.cs Compilation succeeded $ cd ..
- Execute Frogger.exe with Mono:
$ cd frogger $ LD_LIBRARY_PATH=`pwd`/../help mono Frogger.exe