I'm using the android ndk, version r7b on Windows. I'd heard that starting with this version you don't need cygwin or bash to run the ndk-build executable but maybe I'm wrong. In any case I can't seem to get it to work in Eclipse just with 'ndk-build' as the command line option, I still need to stick 'bash' in front of there. Does anyone know whether this is possible?
Right now when I swap out 'bash ndk-build'.... with just 'ndk-build'... Eclipse says:
Cannot run program "c:\temp\android-ndk-r7b\ndk-build": Launching failed
Error: Program "c:/temp/android-ndk-r7b/ndk-build" is not found in PATH
..which is simply not true, the android-ndk-r7b directory is in my PATH environment variable and has been ever since I installed the NDK a week ago. I've opened and closed Eclipse numerous times since then so the value should be available to it. So I'm not sure what's going on here. Do you still need bash for r7b?
(BTW, I'm using c:\temp as the path here because I found out the hard way about NDK not liking directory paths with spaces, and put it there as a quick-fix. It'll find a permanent home eventually.)
-
Try ndk-build.cmd as command to run for building.Mārtiņš Možeiko– Mārtiņš Možeiko2012年02月29日 19:09:12 +00:00Commented Feb 29, 2012 at 19:09
-
Thank you for the reply Mārtiņš. If I do that I get an unexpected end of file error about '[obj/local/armeabi/objs-debug/openal/__/__/__/common/openal/alAuxEffectSlot.o] Error 1', while reverting to the bash command works fine.larryq– larryq2012年02月29日 19:19:45 +00:00Commented Feb 29, 2012 at 19:19
3 Answers 3
Just FYI for others for whom ndk-build is not working.
My setup is: Windows 7, Eclipse[Indigo], NDK 8
instead of ndk-build, ndk-build.cmd is working fine for me.
Comments
Just wanna share the solution. Im using MacOS Lion but it is not platform specific problem. It is in Eclipse environment settings. Go to your project Properties -> C/C++ Build -> Environment. Click Add... and set name as PATH, value as your (echo $PATH) command from terminal/cmd return string without any quotes. This helps me, and i hope will help you too.
Comments
On Windows 8, ndk-r9, Eclipse Indigo:
I got tired of trying to get Eclipse to flow with the ndk-build.cmd.
The solution was to install CygWin and fall back to 'bash ndk-build'