android NDK开发编译C++文件出现Type 'jint' could not be resolved和Unresolved inclusion: 的解决办法

原地址


 今天在编译Android NDK工程的时候,在jni文件夹下的cpp文件中报了一大堆错误,诸如:Unresolved inclusion: <jni.h>、Type 'jint' could not be resolved、Type 'jintArray' could not be resolved等,根据经验,这样的错误肯定是没有包含相应的头文件导致的。

        解决方案:

        选中工程,右键->Properties,点击C/C++ General展开,点击Path and Symbols,在右边Includes下,点击Add,把NDK文件夹下的jni头文件和相应的C++头文件添加进来。一定要填写完整的路径,比如我添加的两个路径分别是:

      E:\AndroidNDK\android-ndk-r10c\toolchains\mipsel-linux-android-4.8\prebuilt\windows-x86_64\lib\gcc\mipsel-linux-android\4.8\include

      E:\AndroidNDK\android-ndk-r10c\platforms\android-19\arch-arm\usr\include


你可能感兴趣的:(android NDK开发编译C++文件出现Type 'jint' could not be resolved和Unresolved inclusion: 的解决办法)