你的位置:首页 > 软件开发 > 操作系统 > unresolved inclusion in the java header in JNI

unresolved inclusion in the java header in JNI

发布时间:2015-12-24 15:00:24
eclipse的ndk开发环境建差不多后打开jni的samples里的hello-jni项目。添加native和运行都没有问题,但是打开hello-jni.c看到一片红:光这一个文件牵涉的问题有下面一些,罗列出来方便搜到。Unresolved inclusion: <str ...

unresolved inclusion in the java header in JNI

 

eclipse的ndk开发环境建差不多后打开jni的samples里的hello-jni项目。添加native和运行都没有问题,但是打开hello-jni.c看到一片红:

unresolved inclusion in the java header in JNI

光这一个文件牵涉的问题有下面一些,罗列出来方便搜到。

Unresolved inclusion: <string.h>

Unresolved inclusion: <jni.h>

Type 'jstring' could not be resolved

Type 'JNIEnv' could not be resolved

Type 'jobject' could not be resolved

还可能有NewStringUTF的Unresoved问题(解决方法在最下面)

原理没研究,解决方法根据情况不同可能涉及到下面的一种或两种方法

方法一,通过重建.project和.cproject解决

来源:http://stackoverflow.com/questions/23122934/eclipse-adt-unresolved-inclusion-jni-h

1. 关闭eclipse

2. 用notepad++等工具打开hello-jni文件夹中的.project文件,把下面三块内容删除

 

    <buildCommand>      <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>      <triggers>clean,full,incremental,</triggers>      <arguments>      </arguments>    </buildCommand>

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:unresolved inclusion in the java header in JNI

关键词:JAVA

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。