Samuel Barreto <[email protected]> writes: > Hi everyone, > > I want to create a Guile extension to a big C++-based project called > Bio++ (dedicated to bioinformatics and computational biology). > > However I failed to find a good and simple example on how to extend a > C++ program with Guile. My idea was to create a shared library that can > be called from Guile and embedded in a module. I followed instructions > on the Guile reference manual but all of them are related to C, not C++. > I then looked at the source code of LilyPond and OpenCog but was not > able to extract signal from software idiosyncratic noise. > > So can anyone point me to a good example or a simple tutorial on how to > extend C++ with Guile ? I think the main confusion point to me is the > compilation danse between g++ and gcc.
You could take a look at LilyPond (which still uses Guile-1.8 but the 1.8/2.x difference is not really relevant to the basic approaches used for interfacing), is written in C++ and interfaces to Guile (with Guile being precompiled as a C library and used as system library if available). In particular, it might make sense to look at the files lily/smobs.cc, lily/include/smobs.hh, lily/include/smobs.tcc, lily/include/small-smobs.hh since LilyPond routes all its Scheme-wrapped data structures through these constructs. A repository viewer can be found at <http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=tree> -- David Kastrup
