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 :-).
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