From: Chris Vine <chris@cvine.freeserve.co.uk>
To: guile-user@gnu.org
Subject: Re: C++ Foreign Function Interface
Date: Thu, 10 Mar 2016 21:17:16 +0000 [thread overview]
Message-ID: <20160310211716.58d94dc8@bother.homenet> (raw)
In-Reply-To: <87a8m6nqm4.fsf@gmail.com>
On Thu, 10 Mar 2016 23:48:43 +0530
Arun Isaac <theroarofthedragon@gmail.com> 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
next prev parent reply other threads:[~2016-03-10 21:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 18:18 C++ Foreign Function Interface Arun Isaac
2016-03-10 21:17 ` Chris Vine [this message]
2016-03-11 17:09 ` Hans Åberg
2016-03-11 20:17 ` Arun Isaac
2016-03-11 22:40 ` Hans Åberg
2016-03-14 16:04 ` Arun Isaac
2016-03-14 19:22 ` Chris Vine
2016-03-14 21:12 ` Jan Wedekind
2016-03-11 23:36 ` David Pirotte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160310211716.58d94dc8@bother.homenet \
--to=chris@cvine.freeserve.co.uk \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).