[gambit-list] [Fwd: Re: Hello World segfaults on me]
David St-Hilaire
sthilaid at iro.umontreal.ca
Sun Feb 3 10:22:59 EST 2008
oups forgot to include the gambit-list in my repluy ;)
-------- Original Message --------
Subject: Re: [gambit-list] Hello World segfaults on me
Date: Sun, 03 Feb 2008 10:15:47 -0500
From: David St-Hilaire <sthilaid at iro.umontreal.ca>
To: Francisco Listas <francisco.listas at gmail.com>
References: <8d9da3cf0802030633j40e82a56gdc3e6d55fe53915a at mail.gmail.com>
Francisco Listas wrote:
> I am running Ubuntu 7.10, and I've just installed (using synaptic) Gambit-C.
> To try my installation, I just wrote (in file hello.scm) this hello
> world program:
>
> (display "Hello World!\n")
>
> Running:
> gsi hello.scm
>
> Produces the expected output.
>
> Running:
> gsc hello.scm
>
> Produces hello.o1 executable file, but when I run it, a segfault occurs:
> ./hello.o1
Thats where your error lies. Here is what you should do instead:
dave at david ~/temp $ echo '(display "allo tout le monde!\n")' > test.scm
dave at david ~/temp $ gsi test.scm
allo tout le monde!
dave at david ~/temp $ gsc test.scm
dave at david ~/temp $ gsi test
allo tout le monde!
dave at david ~/temp $
I am not 100% sure here but I believe that the .o1 file format is some kind of
gambit byte code. To get an executable, you need to do the following:
dave at david ~/temp $ echo '(display "allo tout le monde!\n")' > test.scm
dave at david ~/temp $ gsc -link test.scm
dave at david ~/temp $ gcc test.c test_.c -lgambc
dave at david ~/temp $ ./a.out
allo tout le monde!
dave at david ~/temp $
Hope that could help you! :D
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20080203/9813c607/attachment.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20080203/9813c607/attachment-0001.sig>
More information about the Gambit-list
mailing list