I've look for a solutions to my trouble and just get some clues, but I could not find any consistent solution: I have the code of a dynamic library (libdyna.so), that uses the functions of 3 statics libraries (libone.a, libtwo.a, libthree.a) and the log4cpp library. And when I built it the first time everything looked fine, I could make the 'libdyna.so', but when y tested it with my java test program though a wrapper (the jni wrapper works fine) I got lots of undefined references.
Then I put the "-z defs" flag to the make file and a lot of undefined references appear and I could not compile the dynamic library again.
I've made the 'nm' command with the three statics libraries and it exports all the functions that I use in the dyna lib correctly. But when I made nm over the 'libdyna.so', the one which includes the 3 statics libs, I found Undefined symbols (functions).
I think that the solutions must be something like adding some flag to the linker when I want to made the dynamic one, but i really don't know. Could anyone help me, or tell me some ideas?. if some code is needed please let me know and I'll paste it here. Thanks a lot.
P/D: Sorry for my bad english.