On Mon, 26 Dec 2016, saffronsn...@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
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