Tuesday, 26 September 2017

java - jni can't find method from native lib?

in Java ,the native method :



public native String hello();



package name:  pack

class name: Hello



C++: method name:



jstring
Java_pack_Hello_hello
(
JNIEnv* env,
jobject this
)



I use ndk compile this file ,but app crash ;



after i add this line : extern "C" into my hello.cpp
the error is gone ,every thing is ok.



so why ?

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...