Create executable using Gambit on Windows?

Discussion of Scheme and Racket
Post Reply
anta40
Posts: 19
Joined: Fri Oct 10, 2008 10:27 pm
Contact:

Create executable using Gambit on Windows?

Post by anta40 » Thu Jun 25, 2009 6:41 am

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

Code: Select all

int power_of_2 (int x) { return 1<<x; }
m2.scm

Code: Select all

(c-declare "extern int power_of_2 ();")
(define pow2 (c-lambda (int) int "power_of_2"))
(define (twice x) (cons x x))
m3.scm

Code: Select all

(write (map twice (map pow2 '(1 2 3 4)))) (newline)
Then next step is to compile it:

Code: Select all

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:

Code: Select all

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?

gcartier
Posts: 4
Joined: Tue Sep 02, 2008 5:22 am

Re: Create executable using Gambit on Windows?

Post by gcartier » Sat Jun 27, 2009 6:27 am

Your best bet is to send your question to Gambit's mailing list at Gambit-list@iro.umontreal.ca

Post Reply