Colin, Gambit does its own compilation work using /usr/local/Gambit-C/bin/gambc-cc , check it out. Run Gambit with the env var GAMBC_CC_VERBOSE=yes set and thescript will print out what it does, giving you a better clue. Mikael

2015-02-11 10:10 GMT+05:30 Colin Gilbert <colingilbert86@gmail.com>:
Hi,

Pardon the silly noob question, but I've been trying to use Gambit to quickly write up a small submodule, and then use each target's native compiler to embed it into the build. Unfortunately, I am getting link errors:

Is my my mini program:
hello.scm: (display "hello") (newline)

Here is what happens when I try to use it.

>> gsc -c hello.scm
*** INFO -- loading syntax expander

>> gcc hello.c

cc hello.c
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/ccpGbiFh.o: In function `___H__20_hello':
hello.c:(.text+0x8d): undefined reference to `___gstate0'
hello.c:(.text+0xd4): undefined reference to `___gstate0'
hello.c:(.text+0xee): undefined reference to `___G_display'
hello.c:(.text+0x132): undefined reference to `___G_display'
hello.c:(.text+0x144): undefined reference to `___gstate0'
hello.c:(.text+0x176): undefined reference to `___gstate0'
hello.c:(.text+0x194): undefined reference to `___G_newline'
hello.c:(.text+0x1d5): undefined reference to `___G_newline'
hello.c:(.text+0x1e7): undefined reference to `___gstate0'
/tmp/ccpGbiFh.o: In function `___setup_mod':
hello.c:(.text+0x25c): undefined reference to `___G__20_hello'
/tmp/ccpGbiFh.o: In function `___init_mod':
hello.c:(.text+0x26f): undefined reference to `___gstate0'
hello.c:(.text+0x281): undefined reference to `___G__20_hello'
/tmp/ccpGbiFh.o: In function `____20_hello':
hello.c:(.text+0x29b): undefined reference to `___S_hello'
collect2: error: ld returned 1 exit status

I tried using -link, -flat,-link -flat but no real difference.

What files need to be present before you can compile the code natively?


_______________________________________________
Gambit-list mailing list
Gambit-list@iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list