0

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?

4

3 回答 3

0

我在 Windows XP 中也有一个(非活动的)G: 驱动器(为其分配了一些 USB 驱动器)。这可以防止使用 NDK r4 进行一些构建,我无法理解为什么有时会弹出错误。

无论如何,这是解决方法:

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

  2. 使用 cygwinmount -c ccc更改 cygdrive 路径前缀

  3. 创建缺少的目录:

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

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

于 2010-10-27T12:03:26.470 回答
0

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

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

能否尝试从官网重新下载并重新解压 NDK 包,看看是否能解决问题?

于 2010-05-25T19:10:56.307 回答
0

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

于 2010-06-26T10:43:27.867 回答