[plt-scheme] mzc embedding question

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Nov 30 12:36:29 EST 2007

At Fri, 30 Nov 2007 10:32:54 -0700, Chongkai Zhu wrote:
> Matthew Padilla wrote:
> > Hello,
> >  
> > I would like to compile a C++ program that embeds MzScheme, similar to 
> > the example given in the online documentation (see example at end of 
> > email).  I would like to be able to pass it
> > strings representing arbitrary Scheme programs, and have it evaluate them.
> >  
> > I am running Microsoft's Visual C++ Express, on a Vista machine. 
> >  
> > Am I mistaken, or can I use mzc for this purpose?  It seems as though 
> > mzc makes life easier by resolving linkage issues, etc. (e.g. to 
> > MzScheme libraries) but I'm not sure if this is only for
> > extension writing.  I've managed to produce .obj files via mzc... but 
> > not an .exe.
> 
> Sure you can.
> 
> mzc --cc yourfile.c
> mzc --ld yourfile.exe yourfile.obj
> 
> should work.

Actually, I don't think this works. `mzc --ld' is set up for linking
shared objects that are loaded as extensions.

I don't think `mzc' is going to be much help for creating embedding
executables. It tries to use all the right compiler/linker flags for
creating extensions, which are usually not the right flags for creating
embeddings.

Matthew



Posted on the users mailing list.