[plt-scheme] Trouble embedding scheme on Mac OS X
I've figured out a way to avoid the bus error: Use
scheme_set_stack_base to set the stack base. The documentation doesn't
mention that this is necessary. Any clue why this may be necessary?
Thanks,
Norbert
On 24-Sep-04, at 11:59 PM, Norbert Zeh wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Well, ultimately I am trying to have a scheme back-end for a Cocoa
> GUI; but since I got bus errors in there, I tried whether the sample
> code from the PLT documentation would work. I also tried to link
> against the PLT_MzScheme framework, and I tried to build it on my
> second machine to see whether something was funny about this
> machine/installation; all to no avail.
>
> Thanks for trying anyway.
>
> Norbert
>
> On 24-Sep-04, at 11:17 PM, Richard Cleis wrote:
>
>> I changed your build-line to match my machine, but I used the
>> lib*.a's that were created by activities of so long ago that I can't
>> help you much:
>>
>> gcc -o test_scheme test_scheme.c ../../plt/src/mzscheme/libmzscheme.a
>> ../../plt/src/mzscheme/libmzgc.a -L../../plt/include -I../../plt/lib
>>
>> I must confess that I don't fully understand what you are trying to
>> do with that line, since I use Project Builder for embedding.
>>
>> Anyway, the above builds and runs fine on 10.3.5 here in lower North
>> America.
>>
>> rac
>>
>>
>>
>>
>> On Sep 24, 2004, at 6:25 PM, Norbert Zeh wrote:
>>
>>> For list-related administrative tasks:
>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>
>>> Hi folks:
>>>
>>> I am having trouble building an application that has PLT scheme
>>> embedded in it. My environment is OS X 10.3. I tried to compile
>>> and run the first bit of sample code from "Inside PLT Scheme":
>>>
>>> #include <stdio.h>
>>> #include <scheme.h>
>>>
>>> int main (int argc, char * argv[]) {
>>>
>>> Scheme_Env *e = scheme_basic_env();
>>> Scheme_Object *curout = scheme_get_param(scheme_config,
>>> MZCONFIG_OUTPUT_PORT);
>>> int i;
>>> for(i = 1; i < argc; i++) {
>>> if(scheme_setjmp(scheme_error_buf)) {
>>> return -1;
>>> } else {
>>> Scheme_Object *v = scheme_eval_string(argv[i], e);
>>> scheme_display(v, curout);
>>> scheme_display(scheme_make_character('\n'), curout);
>>> scheme_apply(scheme_builtin_value("read-eval-print-loop"), 0,
>>> NULL);
>>> }
>>> }
>>> return 0;
>>> }
>>>
>>> It compiles and links fine; but when I run it, I get a "bus error".
>>> This even happens when I build the following piece of code:
>>>
>>> #include <stdio.h>
>>> #include <scheme.h>
>>>
>>> int main (int argc, char * argv[]) {
>>>
>>> Scheme_Env *e = scheme_basic_env();
>>> return 0;
>>> }
>>>
>>> So something weird seems to happen inside scheme_basic_env(). Any
>>> idea what I may be doing wrong?
>>>
>>> In case this matters, I use the following line to build the code:
>>>
>>> gcc -o test_scheme test_scheme.c -lmzscheme -lmzgc
>>> -L../../plt/include -I../../plt/lib
>>>
>>> Thanks,
>>> Norbert
>>>
>>
>