collapse Table of Contents
  1. Frogger under Mono - Jonathan Pryor's web log
    1. Frogger under Mono

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.

  1. Download and extract pnetcurses:
    $ wget
    $ tar xzf pnetcurses-0.0.2.tar.gz
    $ cd pnetcurses-0.0.2
  2. Build the helper library. You can ignore the warnings produced by GCC.
    $ cd help
    $ gcc -shared -o *.c -lncurses
    input.c: In function `CursesHelpGetNextChar':
    input.c:69: warning: integer constant is too large for "long" type
    $ cd ..
  3. Build the Curses.dll wrapper library:
    $ cd src
    $ mcs -t:library *.cs -out:Curses.dll
    Compilation succeeded
    $ cd ..
  4. 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
      <dllmap dll="cygncurses5.dll" 
      <dllmap dll="libcsharpcurses-0-0-1.dll"
    $ cd ..
  5. 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 ..
  6. Execute Frogger.exe with Mono:
    $ cd frogger
    $ LD_LIBRARY_PATH=`pwd`/../help mono Frogger.exe
Posted on 08 Apr 2005 | Path: /development/mono/ | Permalink
blog comments powered by Disqus