dynamic lib can't find static lib
- by renyufei
env: gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
app: Bin(main) calls dynamic lib(testb.so), and testb.so contains a static lib(libtesta.a).
file list:
main.c
test.h
a.c
b.c
then compile as:
gcc -o testa.o -c a.c
ar -r libtesta.a testa.o
gcc -shared -fPIC -o testb.so b.c
gcc -o main main.c -L. -ltesta -ldl
then compile success, but runs an…