[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: good tutorial on extending a c++ project with Guile ?

From: Panicz Maciej Godek
Subject: Re: good tutorial on extending a c++ project with Guile ?
Date: Mon, 26 Jun 2017 15:03:19 +0200

2017-06-26 14:45 GMT+02:00 Samuel Barreto <address@hidden>:

> 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.
Hi Samuel,
I think that the tutorial from the Guile reference manual should be
as C++ is mostly a superset of C -- you only need to be careful about
making the
loadable functions binary-compatible with C, by marking them
extern "C". You can do this per function, by writing, say

extern "C" void init_bessel();

or per module, as in

extern "C" {
  // ...
  void init_bessel()
  // ...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]