我参考网上:一个打通jni,java framework,application三层的练习
完全按照步骤做的,现在我在frameworks/base/core/jni目录下面敲mm编译出现如下错误:target thumb C++: libandroid_runtime <= frameworks/base/core/jni/android_mytest_hellojni.cpp
target thumb C++: libandroid_runtime <= frameworks/base/core/jni/AndroidRuntime.cpptarget SharedLib: libandroid_runtime (out/target/product/msm8660_surf/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/LINKED/libandroid_runtime.so)
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/msm8660_surf/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/AndroidRuntime.o: in function android::gRegJNI:AndroidRuntime.cpp(.data.rel.ro._ZN7androidL7gRegJNIE+0x0): error: undefined reference to 'register_android_mytest_hellojni(_JNIEnv*)'
collect2: ld returned 1 exit status我在Android.mk中已经添加了源文件了:
LOCAL_SRC_FILES:= \
ActivityManager.cpp \
android_mytest_hellojni.cpp\而且上面也显示编译了android_mytest_hellojni.cpp,在AndroidRuntime.cpp中也申明了函数register_android_mytest_hellojni,为何报未定义呢?
望高手指点!