<div>Thanks, that's exactly what I was looking for!<br></div>
                <div><div><br></div>-- <br>Per Eckerdal<div><br></div></div>
                 
                <p style="color: #A0A0A8;">On torsdag 10 november 2011 at 21:33, Marc Feeley wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div><br></div><div>On 2011-11-10, at 2:37 PM, Per Eckerdal wrote:</div><div><br></div><blockquote type="cite"><div><div>Hi,</div><div><br></div><div>I'm trying to compile a scheme file that uses Gambit's compiler functions to a standalone executable. Is there any good/obvious way of doing that?</div><div><br></div><div>This illustrates my problem:</div><div><br></div><div>$ cat t.scm</div><div>(write compile-file)</div><div>$ gsc -exe t.scm</div><div>*** WARNING -- "compile-file" is not defined,</div><div>***            referenced in: ("/Users/per/prog/gambit/blackhole/tmp/t.c")</div><div>$ ./t</div><div>#!unbound</div></div></blockquote><div><br></div><div>Because you are linking with more than the base library, you need additional linking steps:</div><div><br></div><div>1) explicit linking (with gsc -link) with the link file ~~lib/_gambcgsc.c (this is an incremental link because this link file extends the base library)</div><div><br></div><div>2) explicit linking (at the C level) with the library ~~lib/libgambcgsc.a</div><div><br></div><div>Here's an example, tested on Mac OS X:</div><div><br></div><div>% ls t*</div><div>t.scm</div><div>% cat t.scm</div><div>(pp compile-file)</div><div>% GAMBCLIBDIR="`gsc -e \"(display (path-expand \\\"~~lib\\\"))\"`"</div><div>% gsc -link -l "$GAMBCLIBDIR/_gambcgsc.c" t.scm</div><div>% gsc -obj t_.c t.c</div><div>t_.c:</div><div>t.c:</div><div>% gsc -exe -ld-options "$GAMBCLIBDIR/libgambcgsc.a" t_.o t.o</div><div>% ./t</div><div>#<procedure #2 compile-file></div><div>% ls t*</div><div>t     t.c     t.o     t.scm   t_.c    t_.o</div><div><br></div><div>Marc</div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>