[gambit-list] Newby question on compiling Gambit output
Marc Feeley
feeley at iro.umontreal.ca
Tue Jul 11 17:22:16 EDT 2006
First of all beta 9 is quite old and it has a few known bugs on
Windows. You should use beta 17.
After a "./configure" and a "make" and a "make install", Gambit-C
will be installed in:
c:/msys/1.0/local/Gambit-C
Then you can compile a standalone program like this:
feeley at NEO-XP ~/gambc40b17
$ cat foo.scm
(display "hello world\n")
feeley at NEO-XP ~/gambc40b17
$ c:/msys/1.0/local/Gambit-C/bin/gsc foo.scm
feeley at NEO-XP ~/gambc40b17
$ gcc -I c:/msys/1.0/local/Gambit-C/include foo.c foo_.c c:/msys/1.0/
local/Gambit-C/lib/libgambc.a -lws2_32
feeley at NEO-XP ~/gambc40b17
$ a.exe -:tc
hello world
Of course you can put c:/msys/1.0/local/Gambit-C/bin in your PATH to
access gsi and gsc easier.
As Guillaume Germain mentioned it is probably easier to compile your
program dynamically and load it using the interpreter:
feeley at NEO-XP ~/gambc40b17
$ c:/msys/1.0/local/Gambit-C/bin/gsc -dynamic foo.scm
feeley at NEO-XP ~/gambc40b17
$ c:/msys/1.0/local/Gambit-C/bin/gsi -:tc foo
hello world
Note that the -:tc option is a temporary work around for a bug on
Windows.
Marc
On 11-Jul-06, at 9:57 AM, Kenneth Kellum wrote:
> If this is a FAQ, sorry.
>
> I'm trying to use Gambit-C to get an executable version of a Scheme
> program. I'm comfortable with Scheme, but haven't used C in many
> years.
>
> I'm running Windows XP. I downloaded Gambit-C, version 4.0 beta 9.
> I've succeeded in using Gambit to translate foo.scm into foo.c.
>
> After quite a while looking for documentation I'm still clueless as to
> how to compile and link foo.c. I've tried both MS Visual Studio and
> Watcom-1.3.
>
> Any help will be greatly appreciated.
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> http://mailman.iro.umontreal.ca/mailman/listinfo/gambit-list
More information about the Gambit-list
mailing list