[plt-scheme] Trouble embedding scheme on Mac OS X

From: Richard Cleis (rcleis at mac.com)
Date: Fri Sep 24 22:17:42 EDT 2004

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
>



Posted on the users mailing list.