[plt-scheme] question about creating an executable under WindowsusingAllegro

From: Alex Mitchell (alexm at nus.edu.sg)
Date: Sun May 6 23:29:32 EDT 2007

Hi Jon,

That seems to have done it, thanks! I'll let you know if I notice
anything else that seems to have been broken by this.

Alex

-----Original Message-----
From: Jon Rafkind [mailto:workmin at ccs.neu.edu] 
Sent: Monday, May 07, 2007 1:49 AM
To: Jon Rafkind
Cc: Alex Mitchell; plt-scheme at list.cs.brown.edu
Subject: Re: [plt-scheme] question about creating an executable under
WindowsusingAllegro

Jon Rafkind wrote:
> Anyway the main problem is the libaries exist in a non-official place,

> namely $package/lib and $package/allegro-4.2.0 as opposed to 
> $package/compiled/native. Once I made this directory and moved the 
> libraries there mzc was able to handle it fine. This requires a few 
> changes to the Allegro package as well which I am testing now. I'll 
> release a new version of the package as soon as its working.
I wasn't totally right about that but I did move the internal libraries 
around and now its possible to make a stand-alone directory with 
everything you need to run a program that uses Allegro. I couldn't 
upload the package to planet so you can download the new package here:
http://www.rafkind.com/jon/allegro-scheme/packages/2/2/allegro.plt

Install it with $ planet -f allegro.plt kazzmir 2 2

To build a stand-alone executable on windows run these commands

$ mzc --exe mygame mygame.ss

$ mzc --exe-dir mydir ++collects-copy c:/Documents and 
Settings/kazzmir/Application Data/PLT 
Scheme/planet/300/360/cache/kazzmir/allegro.plt/2/2/native 
--collects-path native mygame.exe

And just replace the paths and names( mydir, mygame ) with your own.

This solution probably breaks something else along the way but I don't 
know a proper way to load native libraries. When you run program 
normally with mzscheme or drscheme the native libraries are loaded from 
the current load directory + "../native/alleg.so" but inside a 
distribution made with --exe-dir the collects will be copied to 
$dir/lib/plt/mygame/collects/native and there doesn't seem to be a way 
to get $dir/lib/plt/mygame/collects/ dynamically. So adding 
'--collects-path native' solves this problem by putting the 'native' 
directory in $dir/native instead. If you need to use other collects this

might break though..


Posted on the users mailing list.