键入“jint”无法解析,和JNIEnv的,JCLASS [英] Type 'jint' could not be resolved, and JNIEnv, jclass

查看:466
本文介绍了键入“jint”无法解析,和JNIEnv的,JCLASS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图建立一个简单的HelloWorld的Andr​​oid / Java应用程序使用JNI C $ C $℃。我使用的Eclipse靛蓝在Windows 7上安装NDK R8在非空间路径,已在C库终于建立罚款NDK-build.cmd。然而,通过javah的生成的头文件中有未解决的错误,

Trying to build a simple helloWorld android/java application with jni c code. I am using Eclipse Indigo on Windows 7. Installed ndk r8 in a non-space path, have the c library finally building fine with ndk-build.cmd. However, the header file generated by javah has unresolved errors,

  • 键入jint无法解析
  • 键入JNIEnv的无法解析
  • 键入JCLASS无法解析

这不是看到jni.h包括但昨天重新启动这个早晨起床后,该错误已消失。我有一个未解决的JNIEXPORT和JNICALL误差为好,但#defining他们似乎已经解决了。粘在过去3以上。 搜索谷歌和堆栈溢出的答案,但只要有人找到一个解决方案,他们不说什么解决办法是:(

It wasn't seeing the jni.h include yesterday but after a reboot this morning, that error has disappeared. I had an unresolved JNIEXPORT and JNICALL error as well, but #defining them seems to have solved that. Stuck on the last 3 above. Have searched google and Stack Overflow for answers but as soon as someone finds a solution they don't say what that solution was :(

我已经检查了包括Java和C / C ++的观点在项目属性。这似乎是包括我想jni.h目录,我使用了android-14的ARM平台。目标是4.0.3冰淇淋Sanwich(这容易混淆的是API 15?!)。我要去尝试和使用AVD来测试这一点。 我试着关闭/重新打开这个项目,删除从Eclipse和重新导入,但这些方法都工作过。

I've checked the includes in java and c/c++ perspectives in project properties. It seems to be including jni.h directories that I want, I'm using the android-14 for arm platforms. The target is a 4.0.3 IceCream Sanwich (which confusingly is API 15?!). I was going to try and use an AVD for testing this. I've tried closing/reopening the project, deleting from Eclipse and reimporting, but none of that has worked.

我丢失了一些包括?哪些和我应该在哪里设置呢? 真的AP preciate一些帮助。

Am I missing some includes? Which ones and where should I set them? Would really appreciate some help.

推荐答案

最近,我面临着同样的问题。在我的情况下,问题是,我将我的Eclipse项目C ++项目,但我使用的是C型。因此,要解决这个问题,我只是删除了行<自然> org.eclipse.cdt.core.ccnature< /自然> 的.project 从项目目录下的文件:

Recently I've faced with the same problem. In my case the problem was that I converted my Eclipse project to C++ project, but I had used C type. So to solve this problem I simply deleted the line <nature>org.eclipse.cdt.core.ccnature</nature> from .project file from the project directory:

<natures>
 <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
 <nature>org.eclipse.jdt.core.javanature</nature>
 <nature>org.eclipse.cdt.core.cnature</nature>
 <nature>org.eclipse.cdt.core.ccnature</nature>
 <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
 <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
 <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
</natures>

然后重新启动您的Eclipse。欲了解更多信息,可以阅读

这篇关于键入“jint”无法解析,和JNIEnv的,JCLASS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆