This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: how well can guile interface with C++?


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]