I’m having some major difficulty in compiling some sample C code (hello-jni.c) that came with android-ndk-r8b in Eclipse on Windows 7. I followed the instructions from here http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/
(In step 7, I changed ndk-build to bash -c ndk-build to get this to run correctly). Eclipse spits out the following error:
12:23:44 **** Incremental Build of configuration Default for project MyAndroidProject ****
bash -c ndk-build
Install : libhello-jni.so => libs/armeabi/libhello-jni.so
/cygdrive/c/make-3.82/install: line 1: Installation: command not found
/cygdrive/c/make-3.82/install: line 2: AndroidManifest.xml: command not found
/cygdrive/c/make-3.82/install: line 4: syntax error near unexpected token `C'
/cygdrive/c/make-3.82/install: line 4: `Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free'
make: *** [libs/armeabi/libhello-jni.so] Error 2
/cygdrive/c/android-ndk-r8b/build/core/build-binary.mk:418: recipe for target `libs/armeabi/libhello-jni.so' failed
12:23:45 Build Finished (took 1s.82ms)
I’m pretty sure I included all the necessary files and directories and set up the PATH environment variable(in Windows) correctly, but I have no idea why it keeps giving me this error.
edit: Forgot to mention that I was able to compile the code successfully in the Cygwin (latest version) shell. I just want to know if there is a way to do this with Eclipse (Juno), ADT v20.
You should follow the ADT instructions.
Generally speaking, NDK r8b comes with its prebuilt version of make, and can be used without cygwin altogether. For this case, it has ndk-build.cmd.