guile-user
[Top][All Lists]
Advanced

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

Re: C++ Foreign Function Interface


From: Chris Vine
Subject: Re: C++ Foreign Function Interface
Date: Thu, 10 Mar 2016 21:17:16 +0000

On Thu, 10 Mar 2016 23:48:43 +0530
Arun Isaac <address@hidden> wrote:
> Hi,
> 
> Is there any foreign function interface for C++ shared libraries in
> Guile? Can I somehow use the C FFI for this? Is there any
> documentation for this?

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.

Chris



reply via email to

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