This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: how well can guile interface with C++?
- To: Michael Vanier <mvanier@bbb.caltech.edu>
- Subject: Re: how well can guile interface with C++?
- From: Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
- Date: 26 Jul 1999 12:40:41 +0200
- Cc: guile@cygnus.com
- Cc: djurfeldt@nada.kth.se
- References: <199907260450.VAA17823@arathorn>
Michael Vanier <mvanier@bbb.caltech.edu> writes:
> I'm interested in using guile as an extension language for
> programs/libraries written entirely in C++. Are there any issues with
> using guile and C++ that go beyond what one has to do to extend guile in C?
I'm using Guile without problems in a big C++ program.
(See CNS98 proceedings :)
The only things I have to think about is to include the guile header
files within extern "C" braces:
extern "C" {
#include <libguile.h>
}
and do the same with compilation unit init functions:
extern "C" {
void
see_init_dynamic_clamp_interface ()
{
#include "dynclamp.x"
}
}
Otherwise it't just the same as with C.
> One thing that would be *really* cool, once GOOPS stabilizes, is to have a
> version of SWIG that can set up shadow classes in guile (i.e. guile classes
> whose methods correspond with those of underlying C++ classes).
I've included an ugly interface for making such shadow classes in
GOOPS (see fdi.c).
Marius Vollmer has nice plans for a good one.