美文网首页
Eclipse中编写jni c文件中报错Type could n

Eclipse中编写jni c文件中报错Type could n

作者: 程序员学园 | 来源:发表于2017-07-12 20:17 被阅读0次

如下

Type 'JNICALL' could not be resolved
Type 'jstring' could not be resolved
Type 'jclass' could not be resolved
Method 'NewStringUTF' could not be resolved
Symbol 'NULL' could not be resolved

出现的提示信息如下:

Multiple markers at this line
  - Syntax error
  - Type 'JNIEnv' could not be resolved
  - Type 'JNICALL' could not be resolved

是由于没有将jni.h导入的缘故,而这个文件在ndk的目录下面。所以,参照以下步骤:
Project Properties -> C/C++ General -> Path and Symbols
选择include标签,Add -> $Android_NDK_HOME/platforms/android-14/arch-arm/usr/include
且选中All languages. 最后Apply -> OK 这样错误就解决了。

NdkDemo代码已上传至Github

如有不正支出,欢迎留言交流!
我的GitHub
我的CSDN
我的简书
开发笔记

相关文章

网友评论

      本文标题:Eclipse中编写jni c文件中报错Type could n

      本文链接:https://www.haomeiwen.com/subject/tccihxtx.html