unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: saffronsnail@hushmail.com
To: guile-user@gnu.org
Subject: Re: Can't use dynamic-link with any shared object file
Date: Mon, 26 Dec 2016 17:17:22 -0800	[thread overview]
Message-ID: <20161227011722.DB60940104@smtp.hushmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1612262217450.19111@wedemob>

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, spk121@yahoo.com 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	other threads:[~2016-12-27  1:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-26 17:25 Can't use dynamic-link with any shared object file saffronsnail
2016-12-26 22:24 ` Jan Wedekind
2016-12-27  1:17   ` saffronsnail [this message]
2016-12-27  6:18   ` Eli Zaretskii
2016-12-26 22:26 ` Chris Vine
2016-12-26 23:18 ` spk121

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161227011722.DB60940104@smtp.hushmail.com \
    --to=saffronsnail@hushmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).