Eclipse - Method NewStringUTF() could not be resolved

前端 未结 4 1997
萌比男神i
萌比男神i 2020-12-16 02:57

I am working on a simple OpenCV code to display an image after undergoing sobel operation. I have included all the necessary paths to the Project Properties for including th

4条回答
  •  执笔经年
    2020-12-16 03:28

    Chances are that you are using C syntax in CPP file

    I had the same error

    Just switch to the right syntax and Problem will be solved C syntax

    return (*env)->NewStringUTF(env, "Hello from JNI !");
    

    C++ Syntax

    return (env)->NewStringUTF("Hello from JNI !");
    

    After switching from C to C++ syntax my problem got solved.

提交回复
热议问题