我正在尝试编译我的 jnicode 它显示错误
_JNIEnv::GetShortArrayElements(JNIEnv*&, _jshortArray*&, int)'
我的代码是:
extern "C" JNIEXPORT jint Java_com_techgentsia_sound_Opusmain_nativeDecodeBytes (JNIEnv *env, jobject thiz,jbyteArray decoder_insrc,jshortArray decoder_out)
{
int frame_size=320;
jshort* pcm_data_decoder=env->GetShortArrayElements(env, decoder_out,0);
jbyte* opus_data_decoder=env->GetByteArrayElements(env, decoder_insrc,0);
}
编译器中的错误是:
/home/clifford/opusbuild/jni/opus/com_techgentsia_sound_Opusmain.cpp:117:72: error: no matching function for call to '_JNIEnv::GetShortArrayElements(JNIEnv*&, _jshortArray*&, int)'
/home/clifford/opusbuild/jni/opus/com_techgentsia_sound_Opusmain.cpp:117:72: note: candidate is:
/home/clifford/apps/android-ndk-r10/platforms/android-9/arch-arm/usr/include /jni.h:921:13: note: jshort* _JNIEnv::GetShortArrayElements(jshortArray, jboolean*)
/home/clifford/apps/android-ndk-r10/platforms/android-9/arch-arm/usr/include/jni.h:921:13: note: candidate expects 2 arguments, 3 provided