From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: Can't use dynamic-link with any shared object file Date: Mon, 26 Dec 2016 22:26:24 +0000 Message-ID: <20161226222624.3dfc781c@bother.homenet> References: <20161226172500.61B3340101@smtp.hushmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1482791218 5969 195.159.176.226 (26 Dec 2016 22:26:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2016 22:26:58 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Dec 26 23:26:54 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLdjH-0000e7-Gj for guile-user@m.gmane.org; Mon, 26 Dec 2016 23:26:51 +0100 Original-Received: from localhost ([::1]:51913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLdjM-000187-EZ for guile-user@m.gmane.org; Mon, 26 Dec 2016 17:26:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLdj1-00017q-Ga for guile-user@gnu.org; Mon, 26 Dec 2016 17:26:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLdiy-0005ex-59 for guile-user@gnu.org; Mon, 26 Dec 2016 17:26:35 -0500 Original-Received: from smtpout2.wanadoo.co.uk ([80.12.242.42]:42159 helo=smtpout.wanadoo.co.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLdix-0005eI-Mv for guile-user@gnu.org; Mon, 26 Dec 2016 17:26:32 -0500 Original-Received: from bother.homenet ([95.146.108.70]) by mwinf5d20 with ME id QmSQ1u00M1XA07z03mSQPY; Mon, 26 Dec 2016 23:26:28 +0100 X-ME-Helo: bother.homenet X-ME-Date: Mon, 26 Dec 2016 23:26:28 +0100 X-ME-IP: 95.146.108.70 Original-Received: from bother.homenet (localhost [IPv6:::1]) by bother.homenet (Postfix) with ESMTP id 805381212D9 for ; Mon, 26 Dec 2016 22:26:24 +0000 (GMT) In-Reply-To: <20161226172500.61B3340101@smtp.hushmail.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 80.12.242.42 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.user:13058 Archived-At: On Mon, 26 Dec 2016 09:25:00 -0800 saffronsnail@hushmail.com wrote: > Hello, > I am working on a project that involves writing some core > functionality in C/C++ and composing behavior in Guile (as I > understand it, this one of the ways that Guile was intended to be > used). However, I cannot load any libraries with dynamic-link. I first > encountered this with my code, but I'm going to use libc in my > examples since the error message is identical, libc is ubiquitous, and > it is the library that is given as an example in the manual. I am on > Arch Linux and I am fully upgraded; this is the error message that I > get: > ERROR: In procedure dynamic-link: > ERROR: in procedure dynamic-link: file "libc.so", message: "file not > found" > I've seen dynamic-link called with and without the 'so' prefix in > various places, so I have tried using "c", "libc", and "libc.so" as > the argument in my call to dynamic-link. They all produced the same > error message. Other people with a similar problem have been asked to > show the output of `ldd -r` or `ldd -d`. Both of them give me the same > output: > ldd: warning: you do not have execute permission for "/lib/libc.so"not > a dynamic executable > Do you know why this error would occur? Any help you can give me would > be appreciated. > Thanks,saffronsnail As regards libc, on a glibc/linux system the error you report is correct. libc.so is not linkable. It is in fact a text file - do 'cat /usr/lib/libc.so' to see. The one you are looking for is libc.so.6, which is a dynamically executable. As regards your own libraries, who knows? Probably you did not build them as relocatable shared libraries correctly. If dynamic-link works but your guile code cannot find its contents, possibly you have not exported your C++ libraries with C linkage (that is, as extern "C") to suppress name mangling. Beyond saying that you must have done something wrong, it is not possible to say what the problem is. Chris