Eclipse for Windows运行Android NDK项目:
Android NDK例子android-ndk-r10d\samples\hello-jni运行时正确,但是打开hello-jni.c时会出现如下现象:
解决办法:
1. 删掉error ,关闭hello-jni.c 重新编译即可没有错误了,但是这是掩耳盗铃错误依然存在
2. 根本上解决问题:主要是NDK项目找不到头文件,在项目上手动添加
- 右键项目–>Properties–>C/C++ General–>Paths and Symbols
- –>Includes Tab–>Add
- –>Directory(D:\work_java\Android\android-ndk-r10d\platforms\android-21\arch-x86\usr\include)希望编译目标include路径
- –>Add to all languages–>OK–>Yes
- 错误消失
解决问题的更多其他发方法:
http://stackoverflow.com/questions/15899813/eclipse-method-newstringutf-could-not-be-resolved