[gambit-list] Compiling loaded files

Mikael mikael.rcv at gmail.com
Sat Nov 12 04:07:54 EST 2011


You can also compile a.ss b.ss main.ss separately into object files, and
link them together into one executable file. In this case you leave any
load or include out of either of the files.

2011/11/12 Adrien Piérard <pierarda at iro.umontreal.ca>

> > 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.
>
>
> Cheers,
>
> P!
> --
> Français, English, 日本語, 한국어
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20111112/cc532728/attachment.htm>


More information about the Gambit-list mailing list