This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Question on dlopen
- To: libc-alpha@sourceware.cygnus.com
- Subject: Question on dlopen
- From: Tung-Han Hsieh <thhsieh@linux.org.tw>
- Date: Thu, 13 May 1999 22:04:29 +0800
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