[gambit-list] [Fwd: Re: Hello World segfaults on me]

Francisco francisco.listas at gmail.com
Sun Feb 3 11:26:28 EST 2008


David St-Hilaire wrote:
> 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
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>   
Yes it works!, I thought it was something wrong with my toolchain, but 
it was just a problem between the keyboard and my chair.
Thanks, I have to read the documentation more carefully.
Merci David



More information about the Gambit-list mailing list