[plt-scheme] question about creating an executable under Windowsusing Allegro
Hi Jon,
Thanks for looking into this. Here's the code (the first example from
the Allegro Scheme documentation):
(module firstexample mzscheme
;; this require will be used throughout
(require (planet "util.ss" ("kazzmir" "allegro.plt" 1 1)))
(require (planet "keyboard.ss" ("kazzmir" "allegro.plt" 1 1)))
(require (prefix image- (planet "image.ss" ("kazzmir" "allegro.plt" 1
1))))
(require (prefix mouse- (planet "mouse.ss" ("kazzmir" "allegro.plt" 1
1))))
(define (run)
(easy-init 640 480 16) ;; set up Allegro. Use 640x480 for window
demensions and 16 bits per pixel
(easy-exit)) ;; Just quit Allegro
(run)
)
When I compile as I did before - I think I forgot to mention that I was
doing this from the Dr. Scheme menu item, not by using mzc - I got the
same error as before.
So I tried using the command line instead, with results as follows:
Getting #<path:C:\Documents and Settings\alex\Application Data\PLT
Scheme\planet
\300\360\cache\kazzmir\allegro.plt\1\6\keyboard.ss>
Getting #<path:C:\Documents and Settings\alex\Application Data\PLT
Scheme\planet
\300\360\cache\kazzmir\allegro.plt\1\6\private\allegro.ss>
Getting #<path:c:\program files\plt\collects\mzlib\list.ss>
Getting #<path:C:\Documents and Settings\alex\Application Data\PLT
Scheme\planet
\300\360\cache\kazzmir\allegro.plt\1\6\image.ss>
Getting #<path:C:\Documents and Settings\alex\Application Data\PLT
Scheme\planet
\300\360\cache\kazzmir\allegro.plt\1\6\mouse.ss>
Getting #<path:C:\Documents and Settings\alex\Application Data\PLT
Scheme\planet
\300\360\cache\kazzmir\allegro.plt\1\6\private\allegro.ss>
Writing module from #<path:C:\Documents and Settings\alex\My
Documents\research\
scheme\firstexample.ss>
Writing module from #<path:C:\Documents and Settings\alex\Application
Data\PLT S
cheme\planet\300\360\cache\kazzmir\allegro.plt\1\6\mouse.ss>
Writing module from #<path:C:\Documents and Settings\alex\Application
Data\PLT S
cheme\planet\300\360\cache\kazzmir\allegro.plt\1\6\keyboard.ss>
Writing module from #<path:c:\program files\plt\collects\mzlib\list.ss>
Writing module from #<path:C:\Documents and Settings\alex\Application
Data\PLT S
cheme\planet\300\360\cache\kazzmir\allegro.plt\1\6\util.ss>
Writing module from #<path:C:\Documents and Settings\alex\Application
Data\PLT S
cheme\planet\300\360\cache\kazzmir\allegro.plt\1\6\image.ss>
Writing module from #<path:C:\Documents and Settings\alex\Application
Data\PLT S
cheme\planet\300\360\cache\kazzmir\allegro.plt\1\6\private\allegro.ss>
Writing module from #<path:c:\program
files\plt\collects\mzlib\foreign.ss>
Writing module from #<path:c:\program files\plt\collects\syntax\stx.ss>
Writing module from #<path:c:\program files\plt\collects\setup\dirs.ss>
Writing module from #<path:c:\program
files\plt\collects\compiler\private\mach-o
.ss>
Writing module from #<path:c:\program
files\plt\collects\compiler\private\winutf
16.ss>
Writing module from #<path:c:\program
files\plt\collects\config\config.ss>
Writing module from #<path:c:\program
files\plt\collects\setup\configtab.ss>
Setting command line
[output to "firstexample.exe"]
So it seems to compile fine. Then when I try to run it, I get the
following:
C:\Documents and Settings\alex\My Documents\research\scheme>firstexample
ffi-lib: couldn't open ".\\../lib/windows/alleg42.dll" (The specified
module could not be found.; errno=126)
=== context ===
#f::354: loop
Do I need to have the actual Allegro binary distribution installed to
run the .exe? Seems a bit strange, since everything works fine from
within Dr. Scheme.
I tried downloading a binary distribution of Allegro 4.2.1, and put
alleg42.dll in a folder at the location mentioned in the error msg, ie.
../lib/windows/alleg42.dll (this feels like a major hack), but no luck -
now I get the following error:
C:\Documents and Settings\alex\My
Documents\research\scheme>firstexample.exe
ffi-obj: couldn't get "loadpng_init" from
".\\../lib/windows/alleg42.dll" (The specified procedure could not be
found.; errno=127)
=== context ===
foreign.ss:216:2: get-ffi-obj*
#f::354: loop
Any ideas?
thanks!
Alex
-----Original Message-----
From: Jon Rafkind [mailto:workmin at ccs.neu.edu]
Sent: Sunday, May 06, 2007 1:00 PM
Cc: Alex Mitchell; plt-scheme at list.cs.brown.edu
Subject: Re: [plt-scheme] question about creating an executable under
Windowsusing Allegro
Jon Rafkind wrote:
> Alex Mitchell wrote:
>> I've been using Jon Rafkind's Allegro implementation under Dr. Scheme
>> on Windows to create a simple implementation of Logo's turtle
>> graphics. Unfortunately, when I try to create and run an executable,
>> I have problems running the executable.
>>
>> Just in case I was doing something strange in my code, I tried
>> creating an executable from the first example from the Allegro Scheme
>> documentation. It runs fine within Dr. Scheme, and it also compiles
>> fine, but when I run the .exe from Windows I get the following error:
>>
>>
>> require: unknown module: #%foreign
>>
> I finally got around to trying this myself but everything worked fine
> for me. I did this
> $ mzc --exe wormhole wormhole.ss
> Which created wormhole.exe and ran fine( well I had to add (run) to
> the bottom of the module)
>
> Can you show what options you used with mzc? Also can you paste all
> your source so I can reproduce your problem?
Can you add -v to mzc too. Here is what I see
[...output deleted...]
[output to "wormhole.exe"]