By cesarecf
on Wed, 06/20/2012 - 17:12
Hello!!
what i have read: When you add a jni method in cpp you need to register it in JNI (i believe this comes pressetted when it's called the QCAR lib "libQCAR.so") than comes precompiled with the vuforia SDK
Since ImageTargets.h doesn't exist, where is it the header where are declared the methods used by ImageTargets.cpp
or how can i declare it inside ImageTargets.cpp and then register it in the JNI.
Codes:
My cpp own method:
[CODE]
JNIEXPORT void JNICALL
Java_com_qualcomm_QCARSamples_ArtReconTour_ArtReconTour_buscarImagen(JNIEnv*,jobject){
lastTrackableId = -1;
}
[/CODE]
how it's suppossed to be declared that method in JNI:
[CODE]
static JNINativeMethod sMethods[] = {
/* name, signature, funcPtr */
{"buscarImage", "()V", (void*)Java_com_qualcomm_QCARSamples_ArtReconTour_ArtReconTour_buscarImagen},
};
[/CODE]
how i declare it in java:
[CODE]
public native void buscarImagen();
[/CODE]
(i call it in the same way without "public native")
Console error:
"Java_com_qualcomm_QCARSamples_ArtReconTour_ArtReconTour_buscarImagen was not declared in this scope" this points to the line where it says "{"buscarImage", "()V", (void*)Java_com_qualcomm_QCARSamples_ArtReconTour_ArtReconTour_buscarImagen},"
other error:
too many initializers for JNINativeMethod. Error 1
it could be helpful what i need to change to add cpp methods and call it from java. I'm following the exactly structure in others methods of the example, but idk what else am i missing.
Re: How to add your own method on cpp and call it from java (JNI
Re: How to add your own method on cpp and call it from java (JNI
Re: How to add your own method on cpp and call it from java (JNI
Re: How to add your own method on cpp and call it from java (JNI
Re: How to add your own method on cpp and call it from java (JNI