I'm writing bindings to sdl-ttf, and I have the following small program to test that everything compiles and runs:
(include "../src/sdl-interface.scm") (include "sdl-ttf.scm")
(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)
This compiled and ran perfectly via gsc -exe -cc-options '-I/usr/include/SDL/' -ld-options '-L/usr/lib -lSDL -lSDL_ttf' ttf-test.scm
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") (compile-options force-compile: #t cc-options: "-I/usr/include/SDL/" ld-options: "-L/usr/lib -lSDL -lSDL_ttf")
(import "../src/sdl-interface") (import "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
which threw up a bunch of warnings that SDL::* was not defined
Commenting out the first line and compiling it with bsc ttf-test.scm
died with *** ERROR IN module#lib-module-resolver -- Not a valid lib URL "../src/sdl-interface"
even after compiling sdl-interface and sdl-ttf to object files.
Could someone help me get this running?
martin