[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ltdl and inter-library dependencies
From: |
Albert Chin-A-Young |
Subject: |
ltdl and inter-library dependencies |
Date: |
Mon, 23 Oct 2000 17:07:40 -0500 |
User-agent: |
Mutt/1.1.12i |
I have two libraries, libpng.so and libz.so, both compiled with
libtool. The libpng library is installed into /opt/libpng/lib and the
zlib library is installed into /opt/zlib/lib. The platform is
Solaris/SPARC and the version of libtool is from the multi-lang branch.
$ cd /opt/libpng/lib
$ ls
libpng.a libpng.so libpng.so.1.0.0
libpng.la libpng.so.1
$ ldd libpng.so
libz.so.2 => (file not found)
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1
$ grep dependency /opt/libpng/lib/libpng.la
dependency_libs=' -L/opt/zlib/lib /opt/zlib/lib/libz.la -lm'
$ dump -Lv libpng.so | grep RPATH
[no output]
$ cd /opt/zlib/lib
$ ls
libz.a libz.la libz.so libz.so.2 libz.so.2.0.0
So, I have the zlib library in /opt/zlib/lib as a dependency on
libpng.so. Is ltdl suppose to allow me to load libpng.so by
automatically loading the zlib.so dependency? I created the following
test program:
#include <stdio.h>
#include <dlfcn.h>
#include "ltdl.h"
int
main (void) {
void *a, *b;
lt_dlhandle c = NULL;
lt_dlinit ();
c = lt_dlopen ("/opt/libpng/lib/libpng.la");
if (!c) {
printf ("%s\n", lt_dlerror ());
}
}
Running this gives:
$ ./a.out
ld.so.1: ./a.out: fatal: libz.so.2: open failed: No such file or directory
Looking at the truss output:
$ truss ./a.out | grep open
open("/opt/libpng/lib/libpng.la", O_RDONLY) = 3
open("/usr/lib/libm", O_RDONLY) Err#2 ENOENT
open("/opt/zlib/lib/libm", O_RDONLY) Err#2 ENOENT
open("/lib/libm", O_RDONLY) Err#2 ENOENT
open("/usr/lib/libm", O_RDONLY) Err#2 ENOENT
open("libm.la", O_RDONLY) Err#2 ENOENT
open("/opt/zlib/lib/libm.la", O_RDONLY) Err#2 ENOENT
open("/lib/libm.la", O_RDONLY) Err#2 ENOENT
open("/usr/lib/libm.la", O_RDONLY) Err#2 ENOENT
open("/usr/lib/libm.so", O_RDONLY) = 3
open("/opt/zlib/lib/libz.la", O_RDONLY) = 3
open("/usr/lib/libz.a", O_RDONLY) Err#2 ENOENT
open("/opt/zlib/lib/libz.so", O_RDONLY) = 3
open("/usr/lib/libpng.a", O_RDONLY) Err#2 ENOENT
open("/opt/libpng/lib/libpng.so", O_RDONLY) = 3
open("/usr/lib/libz.so.2", O_RDONLY) Err#2 ENOENT
open("/opt/libpng/lib/libpng.so", O_RDONLY) = 3
open("/usr/lib/libz.so.2", O_RDONLY) Err#2 ENOENT
--
albert chin (address@hidden)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ltdl and inter-library dependencies,
Albert Chin-A-Young <=