[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: maybe I misunderestood something...

Quoting Paul Argentoff:
> STEP 3: $ gcc -o test -L/usr/local/drscheme/collects/mzscheme/lib/i386-freebsd -lgc -lmzscheme test.o
> test.o: In function `main':
> test.o(.text+0x7): undefined reference to `scheme_basic_env'
> test.o(.text+0x11): undefined reference to `scheme_current_process'
> test.o(.text+0x3c): undefined reference to `scheme_current_process'
> test.o(.text+0x75): undefined reference to `scheme_eval_string'
> test.o(.text+0x8d): undefined reference to `scheme_display'
> test.o(.text+0x9c): undefined reference to `scheme_char_constants'
> test.o(.text+0xa7): undefined reference to `scheme_display'
> Why? What have I forgotten?

The order of -l matters. Try

   gcc ... test.o -lmzscheme -lgc

> Next. I have also found a chapter how to build a "standalone executable 
> from native code", but the case described there differs fro mine. 

Yes -- as far as I can tell, you don't want that chapter at all.

> 1. Make a c-coded app with embedded interpreter;
> 2. Make an *.ss file(s) containing scheme callbacks to events generated by 
> c code;
> 3. On runtime main app should take *.ss file(s), parse (and probably 
> byte-compile) them and
> 4. Execute scheme callbacks when needed by c-events.

It doesn't like you you need to do anything special: your embedding
application can simply call scheme_load() to load in *.ss files.