Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiling Gambit on Windows

10 views
Skip to first unread message

phi5...@yahoo.ca

unread,
Mar 28, 2008, 1:17:22 AM3/28/08
to
I am trying (without success) to compile Scheme programs using the
gambit compiler. I searched the web, and noticed that I am not the
only one who failed. The manual does not help much, since it gives
examples for Mac OS-X, and for Linux, but none for Windows. Here is
what I did:

gsc -link test.scm

This generates two files:

test.c
test_.c

I have been able to generate a test.o from these files, and load it
from the interpreter. However, what I want is a stand alone exec file.
The manual recomends that I do the following:

gcc -L lib -lgambc test.c test_.c

I did it, but got the errors below. If anyone knows how to compile
gambit program on Windows (mingw), please, give me a hint.

D:\Gambit-C\v4.2.4>gcc -L lib -lgambc test.c test_.c
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/ccSqbaaa.o:test.c:(.text+0x68):
undefined refe
rence to `___gstate'
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/ccSqbaaa.o:test.c:(.text+0x94):
undefined refe
rence to `___gstate'
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/ccSqbaaa.o:test.c:(.text+0xa9):
undefined refe
rence to `___G_display'
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/ccSqbaaa.o:test.c:(.text+0xe2):
undefined refe
rence to `___G_display'
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/ccSqbaaa.o:test.c:(.text+0xe8):
undefined refe
rence to `___gstate'
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/cce4baaa.o:test_.c:(.text+0x52):
undefined ref
erence to `___main_char'
C:\DOCUME~1\Eduardo\CONFIG~1\Temp/cce4baaa.o:test_.c:(.data+0x0):
undefined refe
rence to `____20___gambc'
collect2: ld returned 1 exit status

I am having problems with mzscheme too. In this case, I am able to
compile the programs, but not to optimize them. Since I do not know
the optimization options, my compiled programs a terribly large, and
inefficient (from 6 to 20 times slower than Bigloo, or Stalin,
depending on the problem). From the IDE, I could not find any tool for
setting optimization options. Again, if somebody knows how to improve
the speed, and size of DrScheme programs, let me know. Of course, my
priority is Gambit, since I heard that it is the fastest Scheme in
town (smile :-).

Marc Feeley

unread,
Mar 28, 2008, 11:02:08 PM3/28/08
to

On Windows, this should work (tested with MinGW):

% gsc -link test.scm
% gcc -IC:/PROGRA~1/Gambit-C/v4.2.5/include -LC:/PROGRA~1/Gambit-C/
v4.2.5/lib -D___SINGLE_HOST test.c test_.c -lgambc -lws2_32 -o
test.exe
% test.exe

Marc

0 new messages