[gambit-list] moving to blackhole

Mikael mikael.trash at gmail.com
Mon Oct 5 13:22:34 EDT 2009


Solutions:

Ensure you have the latest version of BH, there was a bug in c-define-type
fixed 2 days ago.

2009/10/5 Martin DeMello <martindemello at gmail.com>

..


> Now I'm trying to convert just this one file to blackhole, loading
> sdl-interface and sdl-ttf as external dependencies. After going
> through the blackhole docs, I tried the following:
>
> (load "~~/lib/modules/build")
>

Move this out of your module files.

(compile-options force-compile: #t
>                 cc-options: "-I/usr/include/SDL/"
>                 ld-options: "-L/usr/lib -lSDL -lSDL_ttf")
>

This is to be put in the headers in your module files, i.e. your
sdl-interface.scm and sdl-ttf.scm.
force-compile: #t is, as I understand your case, superflouous - the c-ffi
code you have will make BH flip force-compile to #t by itself.


> (import "../src/sdl-interface")
> (import "sdl-ttf")
>

Drop the quotation marks. Also you can group the two into one. I.e.  (import
../src/sdl-interface sdl-ttf)


> (define (main)
>  (SDL::initialize SDL::init-everything)
>  (TTF::init)
>  (SDL::set-window-caption "Hello World" "Hello World")
>  (let* ((screen (SDL::set-video-mode 640 480 32 SDL::swsurface))
>         (courier (TTF::open-font "/usr/share/fonts/TTF/cour.ttf" 10))
>         (stext (TTF::render-text-solid courier "Hello World" 0 0 255 0)))
>    (SDL::BLIT-surface stext 0 0 640 480 screen 0 0 640 480)
>    (SDL::flip screen)
>    (SDL::Delay 2000)
>    (TTF::quit)
>    ))
> (main)


> and tried compiling it with
>  gsc -exe ttf-sdl.scm
>

Producing resultant binaries using BH is not intended to be done this way.

Are you sure that currently, producing binaries is what you really want to
do?

Anyhow, BH's functionality to produce binaries is basic currently. Read the
"Export binaries" section in the documentation.

If I get your program right, you have three files: ../src/sdl-interface.scm
, sdl-ttf.scm , and an unnamed sourcecode file, whose contents you pasted
above. Drop the (load "~~/lib/modules/build") out of the unnamed file, and
follow the other instructions above.

Refer to Per for your further questions on producing binaries, if this is
what you actually want.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20091005/1093992e/attachment.htm>


More information about the Gambit-list mailing list