Eclipse的ADT - 未解决的包容jni.h [英] Eclipse ADT - Unresolved inclusion jni.h

查看:128
本文介绍了Eclipse的ADT - 未解决的包容jni.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Windows平台上,我有ADT包(20140321),并安装NDK(r9d)的最新版本。安装是因为它得到干净。环境变量NDK_ROOT,路径等都是正确定义。

On my Windows platform, I have the latest version of adt bundle (20140321) and ndk (r9d) installed. The installation is as clean as it gets. The environment variables NDK_ROOT, PATH, etc. are all defined properly.

该应用程序我的工作有一定的C ++本地code。在code建立既罚款以外的Eclipse以及在Eclipse。

The app I am working on has some C++ native code. The code builds fine both outside Eclipse as well as within Eclipse.

但问题是,编辑抱怨说jni.h是一个未解决的包容性。

The problem, however, is that the editor complains that jni.h is an unresolved inclusion.

项目 - >属性 - > C / C ++通用 - > PathsAndSymbols节目包括目录和目录中的一个是C:\ ADT \ NDK \平台\ Android为19 \弓臂的\ usr \ include中。我已经验证jni.h是present此目录中。

Project-->Properties-->C/C++ General-->PathsAndSymbols shows include directories and one of the directories is C:\adt\ndk\platforms\android-19\arch-arm\usr\include. I have verified that jni.h is present in this directory.

我已经检查了所有其他消息在这个论坛上,但找不到任何具体的步骤。鸭preciate你的指导。问候。

I have already checked all other messages on this forum but couldn't find any concrete steps. Appreciate your guidance. Regards.

推荐答案

我遇到了类似的问题,一个工作项目与Android NDK为基础code更新到Eclipse开普勒之后。我观察到了类似的事情:头文件将正确地列出包括下的项目,实际建设(通过NDK建造)工作正常,但Eclipse的编辑器无法找到在标准系统目录中的任何标题(以&lt所有标题;>括号中)

I ran into a similar problem with a working project with Android NDK-based code after updating to Eclipse Kepler. I observed similar things: the header files would correctly be listed under "includes" in the project, the actual build (via ndk-build) worked fine, but Eclipse's editor couldn't locate any headers in standard system directories (all headers with < > brackets).

我尝试了许多不同的修复,其中包括交换工具集,重建索引等等都没有成功。

I tried many different fixes, including switching toolsets, rebuilding indices etc. without success.

最后,我删除的C性质完全从项目中,通过在Eclipse中的Android工具菜单。

Finally, I removed the C nature entirely from the project, and added it back via the "Android Tools" menu in Eclipse.

取出C性质:

我能找到可靠排除从项目的C性质是由唯一的办法手动编辑Eclipse的的.project 文件的项目。

The only way I could find to reliably removed the C nature from the project was by hand editing Eclipse's .project file for the project.

  1. 关闭Eclipse项目(例如,通过戒烟的Eclipse)。

  1. Close the Eclipse project (e.g. by quitting Eclipse).

在文本或XML编辑器中的的.project 文件。将有至少2 &LT; buildCommand&GT; 需要删除的节点。删除&LT; buildCommand&GT; 节点名称 org.eclipse.cdt.managedbuilder.core.genmakebuilder 及其所有子和&LT; buildCommand&GT; 节点名称 org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 及其子。最后,删除行:

Open the .project file in a text or xml editor. There will be at least 2 <buildCommand> nodes that need to be removed. Remove the <buildCommand> node with name org.eclipse.cdt.managedbuilder.core.genmakebuilder and all its children, and the <buildCommand> node with name org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder and its children. Finally, remove the lines:

&LT;自然&GT; org.eclipse.cdt.core.cnature&LT; /自然&GT; &LT;自然&GT; org.eclipse.cdt.core.ccnature&LT; /自然&GT; &LT;自然&GT; org.eclipse.cdt.managedbuilder.core.managedBuildNature&LT; /自然&GT; <$c$c><nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>

完全删除 .cproject 文件。

加回了Android原生自然

重新打开Eclipse中的项目。然后在项目资源管理器中右键单击项目,并从Android的工具上下文菜单中,选择添加本机支持......。

Reopen the project in Eclipse. Then right-click on the project in the Project Explorer, and from the "Android Tools" contextual menu, choose "Add Native Support...".

看着前,这种变化后作出的。项目和.cproject文件的变化,看来,它主要是给新的版本号到Android NDK工具。在任何情况下,解决这个问题对我来说。

Looking at the changes made in the .project and .cproject files before and after this change, it appears that it primarily gave new version numbers to the Android NDK tools. In any case, it solved the issue for me.

这篇关于Eclipse的ADT - 未解决的包容jni.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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