简体   繁体   English

jObjectArray尚未声明

[英]jObjectArray has not been declared

In my function, i am trying to get the size of a String array that has been passed to a C++ class through JNI, but i keep getting the error: "jobjectarray has not been declared". 在我的函数中,我试图获得已通过JNI传递给C ++类的String数组的大小,但我不断收到错误:“jobjectarray尚未声明”。 here is my C++: 这是我的C ++:

int targetCount = 0;
    JNIEXPORT void JNICALL
    Java_com_example_processArray(JNIEnv *env, jobject obj, jobjectarray targetsArray){
        targetCount = env->GetArrayLenght(env, targetsArray);
    }

Not sure how to go about this because i thought it uses the Array already passed directly. 不确定如何去做,因为我认为它使用已经直接传递的数组。 Solutions greatly appreciated as always. 解决方案一如既往。 Thanks 谢谢

Use javah to create your jni signatures. 使用javah创建您的jni签名。 jobjectarray is not correct, the correct syntax is jobjectArray jobjectarray不正确,正确的语法是jobjectArray

See Documentation 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM