4

I am attempting to set up my PC to use the Android NDK for my projects. I have Cygwin installed. And I downloaded the Android NDK. Let's say I put the NDK in the following folder on my PC:

c:\Android_ndk\<android ndk folder in here> 

How can I configure Cygwin's path to find the ndk? I am thinking the following may be partially correct:

export PATH=$PATH:/cygdrive/C/Android_ndk/<android ndk folder in here> 

However I am not even sure I have my slashes the right way round.

3 Answers 3

6

Goto ..\cygwin\home\Eclipse. You will find a file named .bashrc. Open it using notepad and at the end of the file add

export PATH=$PATH:/cygdrive/c/Android_ndk/<android ndk folder in here>

If you have done everything correctly the on issuing which ndk-build command on cygwin terminal will give you

/cygdrive/c/Android_ndk/<android ndk folder in here>/ndk-build

Hope this helps you.

Sign up to request clarification or add additional context in comments.

4 Comments

I didn't use notepad, but typed the export command into the Cygwin terminal. Then I checked which ndk-build and it worked. Thank you!
The change to PATH is not persisted between Cygwin sessions. You still want this to be a part of your environment every time you start Cygwin.
Thanks for the info. I changed accoridngly. But I'm actually running ndk-build through cmd.exe now. It's just easier.
Idealy it should be added to .bash_profile instead of .bashrc, see: unix.stackexchange.com/a/26059/78929
4

With latest NDK r8b you don't need cygwin at all! Use ndk-build.cmd from Windows command line or in eclipse.

1 Comment

First add native support to your Android app, then gp to Properties C++ build, and instead of defau build command write ndk-build.cmd with full path
0

add such code in .bashrc

 NDK=D:/android/android-ndk-r9 PATH=${NDK}:$PATH ANT=C:/bin/apache-ant-1.9.2 PATH=${ANT}/bin:$PATH export PATH NDK 

Comments