[gambit-list] calling scheme from C

Bradley Lucier lucier at math.purdue.edu
Sat Jun 13 18:05:31 EDT 2009


On Sat, 2009-06-13 at 07:31 -0400, Marc Feeley wrote:
> 
>     % gsc -link scmlib.scm
>     % gcc main-c-app.c -D___LIBRARY scmlib.c scmlib_.c -lgambc
>     % ./a.out
>     hello montreal
>     returned 8
>     hello world
>     returned 5
> */


Marc:

Once again examples of mixing C and Scheme code on this list contain
incorrect gcc compiler options.  You will quite possibly get incorrect
results in the executable if you don't include -fwrapv,
-fno-strict-aliasing, -mieee (on x86), etc., etc., all those options
that you work so hard to get right in gsc-cc-o.bat.

I recommend that you put together shell-scripts:

gsc-compile-c-to-o
gsc-link-c-to-scheme

that will have the correct options.

This is bug 103.

Brad




More information about the Gambit-list mailing list