views:

332

answers:

4

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?

A: 

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 ?

David Turner
Thanks. I tried to redownload (from the official webpage, as before), and I'm still getting the same thing. I tried to install the linux release on a linux VM, and it seems to work. However, this would make for a very cumbersome build process.
uj2
A: 

Hi,

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 ....

Broqueen
A: 

You could try these (native windows) compilers instead:

http://code.google.com/p/mingw-and-ndk/downloads/detail?name=android-ndk-r4-prebuilt-20100620-windows.tar.bz2&amp;can=2&amp;q=

Disclaimer: I made this package.

mingw.android
A: 

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

Alex Cohn