Android NDK keeps looking for "g/David/..."
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: /cygdriv开发者_运维问答e/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?
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 ?
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 ....
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:
prepare the alternative cygdrive path:
mkdir c:\cygwin\ccc
use cygwin's
mount -c ccc
to change the cygdrive path prefixcreate 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
精彩评论