[plt-scheme] Embedding MzScheme on Mac OS X

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Jul 13 06:53:14 EDT 2009

2009/7/13 Matthew Flatt <mflatt at cs.utah.edu>

> At Sun, 12 Jul 2009 23:44:30 +0200, Jens Axel Søgaard wrote:
> > Hopefully I have missed something obvious - but what?
>
> The Mac frameworks are set up for 3m linking, but I think you mean to
> use the CGC frameworks.


Actually, I started with CGC because the manual said:

    > the embedding process for PLT Scheme CGC or PLT Scheme 3m is
    > essentially the same, but the process for PLT Scheme 3m is most
    > easily understood as a variant of the process for PLT Scheme CGC.


> The simplest solution is to redirect the "PLT_MzScheme" soft link
> within "PLT_MzScheme.framework" to the non-"_3m" version, instead of
> the "_3m" version.
>

That did the trick:
jas$ PLT_MzScheme.framework jensaxelsoegaard$ pwd
/Applications/PLT Scheme Full v4.2.0.2/lib/PLT_MzScheme.framework

jas$ PLT_MzScheme.framework jensaxelsoegaard$ ln -s Versions/
4.2.0.2/PLT_MzScheme .

jas$ gcc -L./pltcur/lib/  -I./pltcur/include/ -F./pltcur/lib/ -framework
PLT_MzScheme -lmzscheme -lmzgc   embedded.c

jas$ ./a.out 1
1


Now for the correct options for 3m. I am missing a library, when I link.

First I changed the symbolic link in the framework back to the original.
Then using the same embedded.c file as before, I did:

jas$ ./pltcur/bin/mzc --3m --c-mods modules.c ++lib scheme/base

jas$ ./pltcur/bin/mzc --3m -x embedded.c

jas$ gcc   -L./pltcur/lib/    -I./pltcur/include/   -F./pltcur/lib/
-framework PLT_MzScheme -lmzscheme3m    embedded.3m.c

jas$ ld  -L./pltcur/lib/ -lmzscheme3m    -F./pltcur/lib/ -framework
PLT_MzScheme   embedded_3m.o
Undefined symbols:
  "___maskrune", referenced from:
      _scheme_do_format in libmzscheme3m.a(string.o)
      _system_type in libmzscheme3m.a(string.o)
      _scheme_symbol_name_and_size in libmzscheme3m.a(symbol.o)
      _scheme_symbol_name_and_size in libmzscheme3m.a(symbol.o)
      _check_dos_slashslash_qm in libmzscheme3m.a(file.o)
      _check_dos_slashslash_qm in libmzscheme3m.a(file.o)
      _is_special_filename in libmzscheme3m.a(file.o)
...

-- 
Jens Axel Søgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090713/7d8092b0/attachment.html>

Posted on the users mailing list.