使用网上的通用教程弄好ndk后,jni folder下的cpp文件中包括的头文件找不到 unresolved inclusion
解决方案是在项目的properties->C/C++ General->Path and Symbols->include中添加自己的java库路径,我的是C:\Program Files\Java\jdk1.8.0_20\include
在编译jni的cpp文件时出现:
jni/NDKtest.cpp:21: error: undefined reference to 'AndroidBitmap_getInfo'
jni/NDKtest.cpp:22: error: undefined reference to '__android_log_print'
jni/NDKtest.cpp:26: error: undefined reference to '__android_log_print'
jni/NDKtest.cpp:29: error: undefined reference to 'AndroidBitmap_lockPixels'
jni/NDKtest.cpp:30: error: undefined reference to '__android_log_print'
jni/NDKtest.cpp:39: error: undefined reference to 'AndroidBitmap_unlockPixels'
collect2.exe: error: ld returned 1 exit status
make.exe: *** [obj/local/armeabi/libNDKtest.so] Error 1
解决方法:在Android.mk文件中加
LOCAL_LDLIBS := -ljnigraphics -llog
完了记得clean