Question on dlopen
Tung-Han Hsieh
thhsieh@linux.org.tw
Thu May 13 07:04:00 GMT 1999
Hello,
I have a question on dlopen(). Suppose that I have a "libA.so"
which is build from
gcc -fPIC -c A.c
gcc -shared -Wl,-soname,A -o libA.so A.o -lB -ldl -L<path of libB.a>
and I also have a "libB.a" which needs the db_open() and other functions
provided by standard libdl of glibc-2.1.1. But libA.so don't need to
call db_open() directly, it will only call the functions of libB.a
directly. libB.a is compiled like this
gcc -c B.c
ar cr libB.a B.o
ranlib libB.a
Now I have a main program which use dlopen() to load libA.so:
void *ldso;
if (! (ldso = dlopen("libA.so", RTLD_LAZY))) {
fprintf(stderr, "dlerror: %s\n", dlerror());
return NULL;
}
But when I run the main program, the dlopen false. The error message is
like that "the dlopen() symbol not found".
Could anyone suggest what should I do? Thank you very much.
T.H.Hsieh
More information about the Libc-alpha
mailing list