首页 > 代码库 > NDK开发中出现各种Semantic Error“XXX 'xxx' could not be resolved”的解决方法

NDK开发中出现各种Semantic Error“XXX 'xxx' could not be resolved”的解决方法

项目要求NDK开发App程序,于是import了工程项目,搭好了环境,结果出现各种

Type ‘xxx‘ could not be resolved 

Method ‘xxx‘ could not be resolved
等等Semantic Error。但是工程本身并不存在错误,可以成功编译。
 
解决方法:明显是没有包含各种头文件造成的,<jni.h>这些头文件包含进工程即可。
右键工程->Properties->C/C++ General->Paths and Symbols->Includes
Add你的包含文件夹即可,例如${NDKROOT}/platforms/android-19/arch-arm/usr/include