I'm trying to compile a native executable who is making use of a shared library. Normally, if I try to run my app I get this:
link_image[1721]: 237 could not load needed library 'libshared-library.so' for '/data/executable' (load_library[1051]: Library 'libshared-library.so' not found)CANNOT LINK EXECUTABLE
Which is somehow understandable giving the fact that the linker only searches /system/lib and /lib. The problem is that we don't have easy access to those directories. However, I found a workaround for this:
LOCAL_LDFLAGS := -Wl,-soname,/data/libshared-library.so
Basically, I just trick the runtime linker.
Which works as expected. But I'm afraid that this is not the correct way of doing it. Can you recommend something more standard for loading shared libraries from native applications (besides creating wrapper app who dlopens all required libs and calls the surrogate "main" function from one of it)?
Cheers,
Andrei
------
Eugen-Andrei Gavriloaie
Web: http://www.rtmpd.com
I don't think it is supported. But System.loadLibrary("foo") should look for /data/data/<package-name>/lib/libfoo.so automatically anyway,and the dynamic linker should look in the same directory for dependent libraries too.