Log in or register to post comments

Unsatisfiedlinkerror with new function

March 9, 2012 - 2:33am #1

Hello there

I created new native functions that I can access from the MultiTargets.java, by declaring them as "private native void nameofthefunction()".

My problem is that I can't find some native functions from the MultiTargetsRenderer.java.

In MultiTargets.cpp :

JNIEXPORT jboolean JNICALL
Java_com_qualcomm_QCARSamples_MultiTargets_MultiTargets_myMethod(JNIEnv *,jobject){ ... }

In MultiTargetsRenderer.java :

public native void myMethod();
public void onDrawFrame(GL10 gl){
[INDENT]myMethod();
}[/INDENT]

Gives me at execution :

java.lang.UnsatisfiedLinkError : myMethod

I don't understand, because methods like renderFrame from MultiTargets.cpp are known by MultiTargetsRenderer.java..

Note : Project is compiled with ndk-build, I cleaned up the project, then re-compiled again...

Thanks,

Re: Unsatisfiedlinkerror with new function

March 10, 2012 - 8:18am #3

Thanks a lot Kim, I did not take a look to the method signature..

Re: Unsatisfiedlinkerror with new function

March 9, 2012 - 9:31am #2

You need to use the Java class name in the method signature:

Java_com_qualcomm_QCARSamples_MultiTargets_MultiTargetsRenderer_myMethod

- Kim

Log in or register to post comments