Android NDK 不断寻找“g/David/...”

发布于 2024-09-03 02:04:14 字数 1417 浏览 4 评论 0原文

我在 Windows 上安装了最新版本的 Android NDK (r4),并全新安装了 cygwin 以及所需的软件包、最新的 Android SDK、Eclipse + Android 插件。

每当我尝试从 cygwin 构建任何 JNI 代码(无论是来自 NDK 的示例,还是 自定义项目),我得到:

$ make APP=demo
Android NDK: Building for application 'demo'
Compile thumb  : demo_lib <= apps/demo/project/jni/demo.c
cc1: error: /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/local/i
nclude: not a directory
cc1: error: /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include
: not a directory
make: *** [out/apps/demo/armeabi/objs/dmeo_lib/demo.o] Error 1

我的名字不是 David,而且我没有 G 驱动器。

似乎这条路径以某种方式硬编码到这个版本中。我尝试在 NDK 目录中查找字符串 g/David 。它出现在许多二进制文件中,一些 .info 文件中,作为某些标头中的注释,以及两个 mkheaders.conf 文件中:

<NDK>\build\prebuilt\windows\arm-eabi-4.2.1\lib\gcc\arm-eabi\4.2.1\install-tools\mkheaders.conf:

SYSTEM_HEADER_DIR="/cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include"

<NDK>\build\prebuilt\windows\arm-eabi-4.4.0\lib\gcc\arm-eabi\4.4.0\install-tools\mkheaders.conf:

SYSTEM_HEADER_DIR="/cygdrive/g/David/ndk/build/platforms/android-3/arch-arm${sysroot_headers_suffix}/usr/include"

将这两个文件更改为指向正确的路径,但我得到完全相同的错误(与原始路径)。

我对 cygwin、unix 或 make 的经验有限。有什么想法吗?

I installed the latest version of the Android NDK (r4) on Windows, plus a fresh installation of cygwin with the required packages, latest Android SDK, Eclipse + Android plugins.

Whenever I try to build any of the JNI code from cygwin (Be it the samples from the NDK, or a custom project), I'm getting:

$ make APP=demo
Android NDK: Building for application 'demo'
Compile thumb  : demo_lib <= apps/demo/project/jni/demo.c
cc1: error: /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/local/i
nclude: not a directory
cc1: error: /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include
: not a directory
make: *** [out/apps/demo/armeabi/objs/dmeo_lib/demo.o] Error 1

My name is not David, and I don't have a G drive.

Seems like this path is somehow hard-coded into this release. I tried looking for the string g/David in the NDK directory. It appears in many of the binaries, some .info files, as comment in some headers, and in two mkheaders.conf files:

<NDK>\build\prebuilt\windows\arm-eabi-4.2.1\lib\gcc\arm-eabi\4.2.1\install-tools\mkheaders.conf:

SYSTEM_HEADER_DIR="/cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include"

and

<NDK>\build\prebuilt\windows\arm-eabi-4.4.0\lib\gcc\arm-eabi\4.4.0\install-tools\mkheaders.conf:

SYSTEM_HEADER_DIR="/cygdrive/g/David/ndk/build/platforms/android-3/arch-arm${sysroot_headers_suffix}/usr/include"

I changed both files to point to the correct path, but I get exactly the same error (with the original path).

I have limited experience with cygwin, unix, or make. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

自由如风 2024-09-10 02:04:14

这可能是 NDK 安装不完整/损坏的症状。

gcc 二进制文件始终在其可执行文件中硬编码原始 sysroot 目录,但如果以其他方式提供了适当的系统头文件和库,通常找不到这些目录。他们应该这样做。

您可以尝试从官方网站重新下载并重新解压NDK包,看看是否可以解决问题?

This is probably the symptom of an incomplete / broken NDK installation.

The gcc binaries always hard-code the original sysroot directory within their executable, but these are not normally found if appropriate system headers and libraries are provided otherwise. And they should.

Can you try re-downloading and re-unzipping the NDK package from the official site, and see if this fixes the problem ?

記憶穿過時間隧道 2024-09-10 02:04:14

我也有同样的问题。
这是因为您可能有一个用于 DVDROM 或 HDD 的 G: 驱动器(对我来说,G: 是 DVDROM)。当我取消激活 G: 驱动器时问题解决了....

I had the same problem.
It's because maybe you have a G: drive for DVDRom or HDD (for me G: was the DVDROM). Problem resolved when i unactivate the G: drive ....

独守阴晴ぅ圆缺 2024-09-10 02:04:14

我在 Windows XP 中也有一个(非活动的)G: 驱动器(为其分配了一些 USB 驱动器)。这会阻止使用 NDK r4 进行某些构建,我不明白为什么有时会弹出错误。

无论如何,解决方法如下:

  1. 准备备用 cygdrive 路径:mkdir c:\cygwin\ccc

  2. 使用 cygwin 的 mount -c ccc 更改 cygdrive 路径前缀

  3. 创建缺失的目录:

mkdir -f /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/local/include

< code>mkdir -p /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include

现在,您可以运行 android-ndk-r4\ndk-build

I have an (inactive) G: drive in Windows XP, too (some USB drive assigned for it). This prevents some builds with NDK r4, and I could not figure why sometimes the error pops up.

Anyway, here's the workaround:

  1. prepare the alternative cygdrive path: mkdir c:\cygwin\ccc

  2. use cygwin's mount -c ccc to change the cygdrive path prefix

  3. create missing directories:

mkdir -f /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/local/include

mkdir -p /cygdrive/g/David/ndk/build/platforms/android-3/arch-arm/usr/include

Now, you can run android-ndk-r4\ndk-build

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文