Hi,<div><br><div>I am trying to get Gambit playing well with SDL, and am running into some strange problems when trying to set up the scheme environment.</div><div><br></div><div>This is the main() function that starts up a SDL window:</div>
<div><br></div><div><div>int main(int argc, char *argv[])</div><div>{</div><div> /* //SETUP */</div><div> ___setup_params_struct setup_params;</div><div> ___setup_params_reset (&setup_params);</div><div> setup_params.version = ___VERSION;</div>
<div> setup_params.linker = SCHEME_LIBRARY_LINKER;</div><div> ___setup (&setup_params);</div><div><br></div><div> x = 0;</div><div> run_stuff(); //Starts a simple SDL animation</div><div><br></div><div> /* //CLEANUP */</div>
<div> ___cleanup ();</div><div>}</div></div><div><br></div><div>Currently everything is still in C, so there are *no* calls to any scheme functions yet. </div><div><br></div><div>I found that the animation runs for about 3 seconds before the whole program hangs. If I comment out __setup(&setup_params), then the program executes normally.</div>
<div><br></div><div>Are there some subtleties when setting up the Gambit environment that I have to watch out for? Is Gambit spawning another thread and causing some deadlock problems? I am fairly certain that SDL is single-threaded, and the whole animation runs in an infinite loop.</div>
<div><br></div><div>I would appreciate any insight people would have on this. Thanks a lot.</div><div> -Patrick</div><div><br></div><div><br><br><div class="gmail_quote">On Wed, Feb 15, 2012 at 1:11 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 2012-02-15, at 1:36 PM, Patrick Li wrote:<br>
<br>
> Hello everyone,<br>
><br>
> I am just getting started using gsc to compile files, and I'm wondering how to go about debugging some error messages I'm seeing.<br>
><br>
> This is what I am doing:<br>
><br>
> == inside misha-sdl.scm ==<br>
> (println "hello world")<br>
><br>
> == inside terminal ==<br>
> gsc -link misha-sdl<br>
> gcc misha-sdl.c misha-sdl_.c -I/Library/Gambit-C/v4.6.2/include -L/Library/Gambit-C/v4.6.2/lib -lgambc<br>
><br>
> == error message ==<br>
> ld: warning: ignoring file /Library/Gambit-C/v4.6.2/lib/libgambc.a, file was built for archive which is not the architecture being linked (x86_64)<br>
> Undefined symbols for architecture x86_64:<br>
> "____gstate", referenced from:<br>
> ____H__20_misha_2d_sdl in cci2oaPA.o<br>
> "____G_println", referenced from:<br>
> ____H__20_misha_2d_sdl in cci2oaPA.o<br>
> "_____20___gambc", referenced from:<br>
> ____linker_tbl in ccR9LONi.o<br>
> "____main_char", referenced from:<br>
> _main in ccR9LONi.o<br>
><br>
> The notice about skipping libgambc.a is especially worrying.<br>
><br>
> However, using the command:<br>
> gsc -o hello -exe misha-sdl.scm<br>
> works perfectly. Is there any way to query to see what flags gsc is passing to gcc?<br>
><br>
<br>
</div></div>You can use the -verbose option to gsc :<br>
<br>
gsc -verbose -o hello -exe misha-sdl.scm<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
<br>
</font></span></blockquote></div><br></div></div>