[Top][All Lists]

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

Re: C++ Foreign Function Interface

From: Arun Isaac
Subject: Re: C++ Foreign Function Interface
Date: Sat, 12 Mar 2016 01:47:49 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Chris Vine <address@hidden> writes:

> If you want to link with a C++ library when using libguile (and, say,
> want to make functions in the library accessible to scheme code using
> scm_c_define_gsubr()), then you need to declare interface functions as
> extern "C" so they have C language linkage.  That will amongst other
> things suppress name mangling and make sure the correct calling
> convention is used.  The same applies if you are planning to use, say,
> pointer->procedure.

I'm trying to use the GNU Radio library (written in C++) from scheme.
While I can't really modify the library itself, I can wrap functions I
need in C, and then call them using Guile's C FFI. I'll do that.

Hans Åberg <address@hidden> writes:

> You will have to write it yourself. It has been discussed before on
> this list [1].

In one of the messages in the earlier thread, I found a link to

That page gives me some idea of how I can write C wrappers for my C++

Attachment: signature.asc
Description: PGP signature

reply via email to

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