[gambit-list] Compiling loaded files

Adrien Piérard pierarda at iro.umontreal.ca
Fri Nov 11 23:47:05 EST 2011

> I have a Scheme file that loads some dependencies:
>    ;; main.ss
>    (load "a.ss")
>    (load "b.ss")
>    (define (main)
>       (call-procs-in-a-and-b))
>    (main)
> I generate an executable like this
>    $ gsc -o myapp -exe main.ss
> When I run `myapp`, it is still looking for `a.ss` and `b.ss`.
> How can I make sure that these files also get compiled and linked to
> the executable?
> Do I have to compile them separately?

LOAD is called at runtime, it is thus normal that it looks for those
files after you compiled.
You can try INCLUDE instead, which is a macro and should textually put
the contents of a.ss and b.ss in main.ss before compilation.
You could also
 gsc a.scm
 gsc b.scm
to compile the two files, then just do (load "a") and (load "b")
without the extension in main.scm, and finally
 gsc -exe main.scm
Then, your binary main will load at run time the compiled binaries
a.o1 and b.o1.


Français, English, 日本語, 한국어

More information about the Gambit-list mailing list