guile-user
[Top][All Lists]
Advanced

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

Re: Can't use dynamic-link with any shared object file


From: Chris Vine
Subject: Re: Can't use dynamic-link with any shared object file
Date: Mon, 26 Dec 2016 22:26:24 +0000

On Mon, 26 Dec 2016 09:25:00 -0800
address@hidden 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



reply via email to

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