Imagination PowerVR SDK Blog

unsatisfiedlinkerror in android PVR



I have a working shared library object for my app ( and it works just fine.

I need to interface with Java and have created a separate shared library ( which gets loaded in java code as

Now, when I launch the app, TalkToJava gets loaded and JNI_ONLoad is callled and I also able to call my c++ functions from Java.

However I need to call functions in from libTalkToJava. I therefore link this in TalkToJava's as

If I now compile (compiles fine with calling functions in and launch, I am getting unsatisfiedlinkerror when the TalkToJava is getting loaded. 
java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1963]:    82 could not load needed library '' for '' (load_library[1105]: Library '' not found)

How can be not found ?? 

Can you please tell me what the problem is and how I can lload a library that is linked in the manner as described above??

mkandula2012-06-15 10:45:00


The answer for this turns out to ensure all the c++ code related to Talk2Java scoped between
extern "C" { }

Apparently the signature of the function in c++ gets changed otherwise !!!

Also if is the "main" library, then you should ONLY load explicitly other .so's in Java code. Thus for my case, I needed to have "extern" calls from  to libTalk2Java. 

mkandula2012-06-20 06:20:36