[gambit-list] Compiling loaded files

Vijay Mathew mathew.vijay at gmail.com
Sat Nov 12 06:47:38 EST 2011


Thanks for helping me out! I decided to load object files and it works fine.

--Vijay

On Sat, Nov 12, 2011 at 2:37 PM, Mikael <mikael.rcv at gmail.com> wrote:
> 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
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
>


More information about the Gambit-list mailing list