guile-user
[Top][All Lists]
Advanced

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

Re: dynamic-link and LD_LIBRARY_PATH


From: Anthony W. Juckel
Subject: Re: dynamic-link and LD_LIBRARY_PATH
Date: Mon, 17 Dec 2001 10:27:12 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.6) Gecko/20011213

Martin Grabmueller wrote:

From: "Anthony W. Juckel" <address@hidden>
Date: Sun, 16 Dec 2001 22:09:36 -0600

Here's the problem. When I try to use (dynamic-link "libname.so") it appears that dynamic-link tries the first path available, but if that doesn't work, it gives up and returns an error. Is there any way to get dynamic-link to search all library paths available until it either finds a working library, or exhausts its choices?


To which path are you referring?  The directories in ld.conf, the PATH
variable or the LD_LIBRARY_PATH?

Your shared objects should either reside in one of the directories in
your ld.conf file (if you run GNU/Linux, don't know about other
systems) or you should add the directory where the shared object is to
your LD_LIBRARY_PATH or LTDL_LIBRARY_PATH environment variables.  The
PATH variable does not matter, it is only used for searching
programs.

I've tried substituting the absolute path to the library, and that seems to work fine, but no luck on getting it to find the library itself. Has anyone else run into this problem? Am I misunderstanding the usage of dynamic-link?


This specific problem I do not understand.  Is it working or not?  I
think it should.

'martin

_______________________________________________
Guile-user mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/guile-user

Ok, here's some more information. I'm referring to LD_LIBRARY_PATH, and I've just tried setting LTDL_LIBRARY_PATH, with much the same result. Ok, with no LD_LIBRARY_PATH or LTDL_LIBRARY_PATH defined, if I try to load libc, here are the errors I get:

[-- BEGIN --]

address@hidden ~ $ ls -l /lib/libc[-.]*
-rwxr-xr-x    1 root     root      1171196 Dec  3 12:07 /lib/libc-2.2.4.so*
lrwxrwxrwx 1 root root 14 Nov 19 11:11 /lib/libc.so.5 -> libc.s
o.5.4.46
-rw-r--r--    1 root     root       565888 Nov 17 14:32 /lib/libc.so.5.4.46
lrwxrwxrwx 1 root root 13 Dec 5 21:07 /lib/libc.so.6 -> libc-2
.2.4.so*
address@hidden ~ $ guile
guile> (dynamic-link "libc.so.6")
standard input:1:1: In procedure dynamic-link in expression (dynamic-link "libc.
so.6"):
standard input:1:1: file: "libc.so.6", message: "file not found"
ABORT: (misc-error)
Type "(backtrace)" to get more information or "(debug)" to enter the debugger.
guile> (dynamic-link "libc.so")
standard input:2:1: In procedure dynamic-link in expression (dynamic-link "libc.
so"):
standard input:2:1: file: "libc.so", message: "/lib/libc.so: cannot open shared
object file: No such file or directory"
ABORT: (misc-error)
guile> (dynamic-link "libc-2.2.4.so")
standard input:3:1: In procedure dynamic-link in expression (dynamic-link "libc-
2.2.4.so"):
standard input:3:1: file: "libc-2.2.4.so", message: "/usr/lib/libc-2.2.4.so: can
not open shared object file: No such file or directory"
ABORT: (misc-error)
guile> (dynamic-link "/lib/libc.so.6")
standard input:4:1: In procedure dynamic-link in expression (dynamic-link "/lib/
libc.so.6"):
standard input:4:1: file: "/lib/libc.so.6", message: "file not found"
ABORT: (misc-error)
guile> (dynamic-link "/lib/libc-2.2.4.so")
#<dynamic-object "/lib/libc-2.2.4.so">
guile> (quit)
address@hidden ~ $

[-- END --]

As you can see, I not only have to give the complete path to the library, but I also have to give the real filename (i.e. I cannot use symbolic links).

Now, if I were to define LD_LIBRARY_PATH or LTDL_LIBRARY_PATH, things get a little more complicated, but the end result is the same. With either of those variables defined, when a relative library path is rejected, the error message says it tried to find it in the first directory defined in my LD_LIBRARY_PATH or LTDL_LIBRARY_PATH, and then gives up. Again, the error message changes, but the net result is the same: I have to give the full path to the real shared library filename in order to use dynamic link.

Is anyone else having similar troubles? Is anyone else able to use dynamic-link just fine?

I am running guile 1.4 on a Debian sid machine, if that helps anyone.

Anthony W. Juckel
Digital Green, LLC.




reply via email to

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