Error: base operand of ‘->’ has non-pointer type ‘JNIEnv’

You are using the C variant, but are compiling with g++, which invokes the C++ compiler (even if your source file has a .c extension). Either change the C variants like [code lang=”c”] (*env)->FindClass(env, …) [/code] to the C++ variants, like [code lang=”c”] env->FindClass(…) [/code] or switch your compiler to gcc to compile the source…


You are using the C variant, but are compiling with g++, which invokes the C++ compiler (even if your source file has a .c extension).

Either change the C variants like

[code lang=”c”]
(*env)->FindClass(env, …)
[/code]

to the C++ variants, like

[code lang=”c”]
env->FindClass(…)
[/code]

or switch your compiler to gcc to compile the source as C code.

Note :- Took reference from here.


Leave a Reply

Discover more from Prabhu System Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading