[gambit-list] Dump a .c file into another program's structure and compile it from another compiler?
Colin Gilbert
colingilbert86 at gmail.com
Tue Feb 10 23:40:24 EST 2015
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150210/f0541548/attachment.htm>
More information about the Gambit-list
mailing list