This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Create executable using Gambit on Windows?

2 posts · 3700 views

Before installing Gambit, I already have MS VC++ 2008 and MinGW 4 installed.

My first pick is of course the Visual C version.
So I make 3 files (copied from the documentation)

m1.c
int power_of_2 (int x) { return 1<<x; }
m2.scm
(c-declare "extern int power_of_2 ();")
(define pow2 (c-lambda (int) int "power_of_2"))
(define (twice x) (cons x x))
m3.scm
(write (map twice (map pow2 '(1 2 3 4)))) (newline)
Then next step is to compile it:
gsc -link m2 m3
The gambit scheme window appeared then suddenly quit. There is no m3_.c created.
I guessed there was something wrong with the visual C version, so I tried the same thing using the MinGW version.
It worked, and indeed there was a m3_.c
And after some trial and errors, I found the required libraries:
gcc m1.c m2.c m3.c m3_.c -o firstprog -lgambc -lwsock32 -lws2_32
The executable ran properly.
I still don't know why the visual C version fails.
Anybody have a similiar experience on this thing?

Re: Create executable using Gambit on Windows?

Your best bet is to send your question to Gambit's mailing list at [email protected]