When using the NDK to compile CPP execution, there are no implementation found for native lcom and other errors, debugging for a long time, only to find
XXX.h and XXX.cpp. In XXX.cpp # # # XXX.h. Unexpectedly appeared No implementation found for native lcom.
Then, XXX.h Delete. All realized in the XXX.cpp, incredibly passed.
NDK is not a direct include compilation (Javah) out of the XXX.h. Suppose you really want to include at least some of the statements to be truncated.
Of course, you can include other. h files.
/* Don't EDIT this file-it are machine generated */#include <jni.h>/* Header for class com_ndk_test_jniclient */// #ifndef _included_com_ndk_test_jniclient//#define _INCLUDED_COM_NDK_TEST_JNICLIENT#IFDEF __cplusplusextern "C" {# endif/* * Class: com_ndk_test_jniclient * Method: addstr * Signature: (ljava/lang/string; ljava/lang/string;) ljava/lang/string; */jniexport jstring jnicall java_com_ndk_test_jniclient_addstr (jnienv *, Jclass, jstring, jstring); */* Class: com_ndk_test_jniclient * Method: AddInt * Signature: (II) I */jniexport jint jnicall java_com_ndk_test_jniclient_addint (jnienv *, Jclass, Jint, Jint); #ifdef __cplusplus} #endif//#endif
#include "com_ndk_test_jniclient.h" #include <stdlib.h> #include <stdio.h> #ifdef __cplusplus extern " C " { #endif/ * * Class: com_ndk_test_jniclient * Method: addstr * Signature: (ljava/lang/string; ljava/lang/string;) ljava/lang/string; */jniexport jstring jnicall java_com_ndk_test_jniclient_addstr (jnienv *env, Jclass arg, jstring InstringA, jstring INSTRINGB) { jstring str = (*env)->newstringutf (env, "HelloWorld from JNI!"); return str; } /** Class: com_ndk_test_jniclient* Method: addint* Signature: (II) i*/jniexport jint jnicall Java_com_ndk_ Test_jniclient_addint (jnienv *env, Jclass Arg, jint A, Jint b) { return a + b;} #ifdef __cplusplus } #endif
Android error--no implementation found for native LCOMD