From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Arun Isaac Newsgroups: gmane.lisp.guile.user Subject: Re: C++ Foreign Function Interface Date: Sat, 12 Mar 2016 01:47:49 +0530 Message-ID: <87vb4s4vma.fsf@gmail.com> References: <87a8m6nqm4.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1457727510 26785 80.91.229.3 (11 Mar 2016 20:18:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2016 20:18:30 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Mar 11 21:18:24 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aeTVu-0000hW-Gn for guile-user@m.gmane.org; Fri, 11 Mar 2016 21:18:22 +0100 Original-Received: from localhost ([::1]:57496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeTVt-00014Q-PY for guile-user@m.gmane.org; Fri, 11 Mar 2016 15:18:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeTVi-000141-C9 for guile-user@gnu.org; Fri, 11 Mar 2016 15:18:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aeTVf-0001Oz-5b for guile-user@gnu.org; Fri, 11 Mar 2016 15:18:10 -0500 Original-Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:35387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aeTVe-0001Ov-TW for guile-user@gnu.org; Fri, 11 Mar 2016 15:18:07 -0500 Original-Received: by mail-pa0-x22b.google.com with SMTP id td3so80710568pab.2 for ; Fri, 11 Mar 2016 12:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=ccehm18DO3S3s4j8fT/PSyD+rS7PMvfrf14Y48cIhb8=; b=Fej8+jqEhhpFiL+If/r+W0Fc3rvHKBTNhCSzm8TBmWZH/QC5vBn1eFv9wzwaSkIHPB /0K0Tg8nuJRfJyHL2vmWiQoZhnrmX2sHD7acKcyM+derSC22RnLSJIJ7WcFJ44gzPmgO X6rtoKD9a43Ngadijdp+PxHnV2tq4b9TYMa+03JUSn0ZbbT49C6rMraUbf80NtYQBBiU 1qnII5QXemI9TvSiKbK39auv+rjL1YZlFXDV1CmXoTLCRfpbbTDqQkDqkHPUn753+t3n 2/B0kcjoeVnIcbp9nj+4mxjdyKLtKfNxmGFlYuqik8JrPySWlzRpI4895sheKs/+Iezc ojfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ccehm18DO3S3s4j8fT/PSyD+rS7PMvfrf14Y48cIhb8=; b=TWvZ+s8uCaJExZ8dabnnahmW99ocShj1eF4PVnPzoCNokxi9NIhKtrrJz5E/HC3cqX Nk4twYpzwrWtyRyb4aBGpvrxRaKaUi5IvlpHqKKmQLshFFJMiFNGuAlBBkWGG9M7GxwB ii9dtmhRqbOgppjVcfpsVWOlSJRIi1IJW91F7MRhU1R/rxbDwTPG0lHasO/0SmIazflF L4D+0dq7tb06OGv2vhlpnr/6V3tYvs+Rv6O+OpZIpVOLtXjyzl7ebVIiZYInX1Z9Aa9T /0pyMpvcg0lgW37yT5HQWxM4JUiqHflHpHIkojoV8Nsa8lD7JB8DnaotI8yXugDA/vsJ eP3Q== X-Gm-Message-State: AD7BkJJeOMbNaG+UbOKHo25xccJeospbElkLAtwlNHaM6nGoIvDBa1rv41KvxZNX/HVXbw== X-Received: by 10.67.6.72 with SMTP id cs8mr18621386pad.138.1457727485722; Fri, 11 Mar 2016 12:18:05 -0800 (PST) Original-Received: from steel ([106.208.55.142]) by smtp.gmail.com with ESMTPSA id p26sm14853895pfi.84.2016.03.11.12.18.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Mar 2016 12:18:04 -0800 (PST) In-Reply-To: ("Hans \=\?utf-8\?Q\?\=C3\=85berg\=22's\?\= message of "Fri, 11 Mar 2016 18:09:47 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::22b X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12471 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Chris Vine 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 =C3=85berg 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 https://isocpp.org/wiki/faq/mixing-c-and-cpp That page gives me some idea of how I can write C wrappers for my C++ library. --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJW4yfuAAoJEC4l7othgCuz9R4H/06zvFtOq8QB8BbsDeAw6c85 Ucw7C03sHaa4LRq1/ZBX7b5wISfScjZfy1Yu0HTkHMKzvfG8SEoR8OA3pvaKWHHB g3yRfENSUiXyhbdaYUaTFG8qNdTkRj7tP4rKRHXFfVBjIW2dA0PzC1mX7OiYz8Fr MWdWxJUzoxYYGd8iJKnHsCb/7JuKXxeSsHGrX707qqk9Dy5uWsfMwMcFlg82qQcN SidDPJ/iFlxEDMWG5vRcXO9/i4WmMWV8zETHOo5NsuXxR0hOzYGjbQCWwFZxwP7o ci3qg9l+i4vXODSxDzR5WXqa0fQ+mV7snSjVzUmp7Gxkill6+TE1WIy4EA+8x6w= =Xt4A -----END PGP SIGNATURE----- --==-=-=-- --=-=-=--