From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.lisp.guile.user Subject: Re: FFI nuisance Date: Thu, 3 Mar 2011 07:43:39 +1300 Message-ID: <20110302184339.GA8884@neko> References: <20110301032724.GA30967@neko> <87pqq9n6jd.fsf@gnu.org> <87zkpdy3v1.fsf@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" X-Trace: dough.gmane.org 1299091534 5442 80.91.229.12 (2 Mar 2011 18:45:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Mar 2011 18:45:34 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 02 19:45:29 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pur3A-0007Ta-Rt for guile-user@m.gmane.org; Wed, 02 Mar 2011 19:45:29 +0100 Original-Received: from localhost ([127.0.0.1]:49527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pur3A-0007pT-4Q for guile-user@m.gmane.org; Wed, 02 Mar 2011 13:45:28 -0500 Original-Received: from [140.186.70.92] (port=36862 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pur1N-00076s-1i for guile-user@gnu.org; Wed, 02 Mar 2011 13:43:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pur16-00033D-LW for guile-user@gnu.org; Wed, 02 Mar 2011 13:43:27 -0500 Original-Received: from jersey.rurallink.co.nz ([114.134.15.197]:49526 helo=smtp.rurallink.co.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pur16-00030n-75 for guile-user@gnu.org; Wed, 02 Mar 2011 13:43:20 -0500 Original-Received: from 114-134-6-192.rurallink.co.nz ([114.134.6.192] helo=localhost) by smtp.rurallink.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Pur0v-00076X-4D for guile-user@gnu.org; Thu, 03 Mar 2011 07:43:10 +1300 Mail-Followup-To: guile-user@gnu.org Content-Disposition: inline In-Reply-To: <87zkpdy3v1.fsf@gmx.at> User-Agent: Mutt/1.5.20 (2009-06-14) X-Rurallink-Authenticated-User: aidalgol@no8wireless.co.nz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 114.134.15.197 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8484 Archived-At: --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 02, 2011 at 03:49:22PM +0100, Andreas Rottmann wrote: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: >=20 > > Hi, > > > > Aidan Gauland writes: > > > >> I'm trying to use SDL through Guile's dynamic FFI. There's a slight > >> nuisance with the procedure `dynamic-link': the name of the so file on > >> my system (Debian squeeze) is `libSDL-1.2.so.0' > > > > Isn=E2=80=99t it a packaging bug? There should be a > > =E2=80=98libSDL-1.2.so=E2=80=99 -> =E2=80=98libSDL-1.2.so.0=E2=80=99 sy= mlink. > > > Only in the -dev package, which should not be required for running Guile > programs that excercise the FFI. It is also good practice to use the > entire SONAME of the library in the Guile program, as to avoid random > breakage when the ABI changes (which does imply a SONAME bump on > sanely-maintained libraries). When I try to use the entire soname of the library, I get an error. (`libSDL-1.2.so.0' is actually a link to the regular file `libSDL-1.2.so.0.11.3'.) What am I doing wrong? Example session: GNU Guile 2.0.0 Copyright (C) 1995-2011 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (define sdl (dynamic-link "libSDL-1.2.so.0.11.3")) ERROR: In procedure dynamic-link: ERROR: In procedure dynamic-link: file: "libSDL-1.2.so.0.11.3", message: "f= ile not found" Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,bt In current input: 1:0 1 (#:1:0 ()>) In unknown file: 0 (dynamic-link "libSDL-1.2.so.0.11.3") scheme@(guile-user) [1]> ,q scheme@(guile-user)> ,q By the way, there is a symlink libSDL.so -> libSDL-1.2.so.11.3, so there is no packaging bug. Now I'm trying to figure out how to do as Andreas says and use the entire soname of the library. --Aidan --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk1uj9sACgkQjyzTRvYJmaW9dgCeJTr3zrW1fH3Gf9uFSwYLoNny b7cAnAxa8UTvgkzoKUoNtP7B3Q3UJVv7 =iyl4 -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--