如何更改内置的C / C ++路径,指向已删除的android-ndk-r9安装? [英] How to change built-in C/C++ paths pointing to a deleted android-ndk-r9 installation?

查看:201
本文介绍了如何更改内置的C / C ++路径,指向已删除的android-ndk-r9安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近把我的NDK从android-ndk-r9升级到了android-ndk-r10(r10d)。 Eclipse是4.4 Luna(Luna Service Release 1(4.4.1); Build id:20140925-1800)。 Eclipse完全修补了它的发行。我更新了所有Eclipse插件(包括ADT),以便它们被完全打补丁。而且我还将 .bash_profile 中的 ANDROID_NDK_ROOT 更改为指向新的NDK目录。



在Eclipse首选项→Android→NDK下,Eclipse显示了新的android-ndk-r10路径(我必须手动设置)。



在项目属性→C / C ++常规→路径和符号下,Eclipse仍然显示旧的android-ndk-r9路径。





Eclipse会考虑内置路径,并取消选中显示内置值复选框使所有路径消失。另外,编辑... 按钮是灰色的。



我已经grep了以下目录,我找不到字符串android-ndk-r9




  • 我的Eclipse工作区

  • 〜/ .eclipse

  • 项目目录

  • 〜/图书馆

  • /应用程序/ Eclipse

  • <$ c OS X机器上的$ c> / etc

  • /库 li>


项目构建正常。错误的配置只会在问题选项卡上的列表中创建数百个错误。 (要复制,您需要打开C或C ++文件):





设置来自哪里?如何更改?






这似乎是相关的:如何从Eclipse CDT项目在Linux上编译后删除自动发现的路径?但是,我找不到发现选项→现在清除发现条目(它似乎是Eclipse 3.x功能)。同上, Eclipse CDT无效的项目路径






这似乎是涵盖以下问题的Eclipse错误报告:包含路径发现不会丢弃编译器升级时的过时路径

解决方案


设置来自哪里?


似乎信息保存在项目的 pathInfo 文件。下面,该项目是一个名为AndroidPrng的JNI项目示例。

  $ cat /Users/jww/Eclipse/.metadata/.plugins $ / $ / $ / $ / / local / cryptopp / android-armeabi / include 
i,/ opt / android-ndk-r9 / sources / cxx-stl / system / include
i,/ usr / local / cryptopp / android-armeabi / include / cryptopp
i,jni
i,/ opt / android-ndk-r9 / platforms / android-14 / arch-arm / usr / include
i,/ usr / local / cryptopp / android-x86 / include
i,/ usr / local / cryptopp / android-x86 / include / cryptopp
i,/ opt / android-ndk-r9 / platforms / android-14 / arch-x86 / usr / include
i,/ usr / local / cryptopp / android-mips / include
i,/ usr / local / cryptopp / android-mips / include / cryptopp
i,/ usr / local / cryptopp / android-armeabi- v7a / include
i,/ usr / local / cryptopp / android-armeabi-v7a / include / cryptopp
i,/ opt / android-ndk-r9 / toolchains / arm-linux-androideabi-4.6 / prebuilt /达尔文-x86_64的/ LIB / gcc / arm-linux-androideabi / 4.6 / include
i,/ opt / android-ndk-r9 / toolchains / arm-linux-androideabi-4.6 / prebuilt / darwin-x86_64 / lib / gcc / arm-linux-androideabi /4.6/include-fixed
i,/ opt / android-ndk-r9 / platforms / android-14 / arch-mips / usr / include
d,__ STDC __,1
d,__ INT64_MAX __,9223372036854775807LL
d,__ LDBL_HAS_QUIET_NAN __,1
d,__ WINT_TYPE __,unsigned int
d,__ ORDER_LITTLE_ENDIAN __,1234
d,__ DEC64_MAX_EXP __,385
d,__ UINT_LEAST32_TYPE __,unsigned int
d,__ UINT_FAST64_TYPE __,long long unsigned int
d,__ GXX_WEAK __,1
...







我已经grep了以下目录... 我的Eclipse工作区,〜/ .eclipse ...


这里有两个问题。首先,项目位于我的桌面上,而不是我的工作区目录。第二, org.eclipse.cdt.ui 下的日志文件中的条目的100个条目淹没了 com.android.ide的条目15条目。 eclipse.ndk



所以,在你grep之前,执行:

  rm用户/ jww / Eclipse / .metadata / .plugins / org.eclipse.cdt.ui / *。log 

这将产生可管理的grep结果。







如何更改?


练习留给读者。



<你可以手工编辑或者您可以删除它,Eclipse将使用新的与NDK相关的路径重新创建它。


I recently upgraded my NDK from android-ndk-r9 to android-ndk-r10 (r10d to be exact). Eclipse is 4.4 Luna (Luna Service Release 1 (4.4.1); Build id: 20140925-1800). Eclipse is fully patched for its release. I updated all the Eclipse plugins (including ADT) so they are fully patched. And I also changed my ANDROID_NDK_ROOT in .bash_profile to point to the new NDK directory.

Under the Eclipse Preferences → Android → NDK, Eclipse is showing the new android-ndk-r10 path (I had to set it manually).

Under the Project Properties → C/C++ General → Paths and Symbols, Eclipse is still showing the old android-ndk-r9 path.

Eclipse considers the path built-in, and unchecking the Show built-in values check box makes all the paths disappear. In addition, the Edit... button is greyed out.

I've grepped the following directories, and I cannot find the string "android-ndk-r9":

  • My Eclipse workspace
  • ~/.eclipse
  • The project's directory
  • ~/Library
  • /Application/Eclipse
  • /etc on the OS X machine
  • /Library on the OS X machine

The project builds fine. The bad configuration just creates hundreds of errors in the list on the Problems tab. (To duplicate, you need to open a C or C++ file):

Where is the setting coming from? And how do I change it?


This appears to be related: How to remove auto-discovered paths after compiling on Linux from Eclipse CDT project?. But I can't find Discovery Options → Clear discovery entries now (it appears to be a Eclipse 3.x feature). Ditto for Eclipse CDT Invalid Project Path.


This appears to be the Eclipse bug report covering the issue: Include path discovery doesn't discard obsolete paths on compiler upgrade.

解决方案

Where is the setting coming from?

It appears the information is held in the project's pathInfo file. Below, the project is a sample JNI project called AndroidPrng.

$ cat /Users/jww/Eclipse/.metadata/.plugins/com.android.ide.eclipse.ndk/AndroidPrng.pathInfo 
t,1421045575000
i,/opt/android-ndk-r9/sources/cxx-stl/stlport/stlport
i,/usr/local/cryptopp/android-armeabi/include
i,/opt/android-ndk-r9/sources/cxx-stl/system/include
i,/usr/local/cryptopp/android-armeabi/include/cryptopp
i,jni
i,/opt/android-ndk-r9/platforms/android-14/arch-arm/usr/include
i,/usr/local/cryptopp/android-x86/include
i,/usr/local/cryptopp/android-x86/include/cryptopp
i,/opt/android-ndk-r9/platforms/android-14/arch-x86/usr/include
i,/usr/local/cryptopp/android-mips/include
i,/usr/local/cryptopp/android-mips/include/cryptopp
i,/usr/local/cryptopp/android-armeabi-v7a/include
i,/usr/local/cryptopp/android-armeabi-v7a/include/cryptopp
i,/opt/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.6/include
i,/opt/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.6/include-fixed
i,/opt/android-ndk-r9/platforms/android-14/arch-mips/usr/include
d,__STDC__,1
d,__INT64_MAX__,9223372036854775807LL
d,__LDBL_HAS_QUIET_NAN__,1
d,__WINT_TYPE__,unsigned int
d,__ORDER_LITTLE_ENDIAN__,1234
d,__DEC64_MAX_EXP__,385
d,__UINT_LEAST32_TYPE__,unsigned int
d,__UINT_FAST64_TYPE__,long long unsigned int
d,__GXX_WEAK__,1
...


I've grepped the following directories ... "My Eclipse workspace, ~/.eclipse, " ...

There were two problems here. First, the project is located on my desktop, and not my workspace directory. Second, the 100's of entries in the log files under org.eclipse.cdt.ui drowned out the entries 15 entries for com.android.ide.eclipse.ndk.

So, before you grep, perform:

rm Users/jww/Eclipse/.metadata/.plugins/org.eclipse.cdt.ui/*.log

That will produce manageable grep results.


And how do I change it?

Exercise left to the reader.

You can edit by hand; or you can delete it and Eclipse will recreate it with the new NDK-related paths.

这篇关于如何更改内置的C / C ++路径,指向已删除的android-ndk-r9安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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