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: saffronsnail
Subject: Re: Can't use dynamic-link with any shared object file
Date: Mon, 26 Dec 2016 17:17:22 -0800

On 12/26/2016 at 2:24 PM, "Jan Wedekind"  wrote:I think "libc" is
normally loaded already. E.g. the C function "abs" can 
be accessed as follows:

     (define main (dynamic-link))
     (define cabs (pointer->procedure long (dynamic-func "abs" main)
(list long)))
     (cabs -42)
     ; 42

Regards
Jan
You're right, the code works on my machine. It turns out that I was
looking at the 1.8 manual, rather than the 2.0 manual, which is why I
had the dated reference to libc. The new manual references libGL,
which I am able to link to.
On 12/26/2016 at 3:18 PM, address@hidden wrote:‎Usually the strace
command or setting the LD_DEBUG=all environment variable can provide
useful info. They often reveal that I should have the LD_LIBRARY_PATH
differently.

An annoyance of dynamic linking is that you also need to make sure
that each shared object's own shared object dependencies are in the
library path. Often when dynamic linking is complaining about
something at appears to clearly exist, it is this recursive linking
that is the problem.
‎LD_DEBUG=all did it! I use Boost in the project, and I thought that
it was going to be linked into my shared object statically, but it
looks like I need to change my cmake file to make that happen. I wish
it told you *which* file was missing, as when it says `file
"libbutler", message: "file not found"` it really does sound like
libbutler is the file that can't be found (though in hindsight it's
pretty clear what they mean).
Thanks for the help!


reply via email to

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