First download cygwin and ndk (I'm using a android-ndk-r7)
When downloading cygwin, You need to select what we want. If you do not know, we recommend that you install it all at the cost.
The current ndk version does not need to be installed, saving the installation step.
After cygwin is installed and ndk is downloaded
1. Configure the ndk environment variable in cygwin (C: \ cygwin \ home \ Administrator \. bash_profile). This is my directory.
Find the cygwin directory, followed by-home-Administrator file name. bash_profile
2. Open the. bash_profile file and add the following two lines (ndk can be named at will)
Ndk =/cygdrive/C/android-ndk-r7 (/cygdrive/drive letter (No:)/ndk directory)
Export ndk
3. Test
Open cygwin and enter CD $ ndk directly to the ndk root directory. The ndk environment configuration is complete.
Go to any project subdirectory in the samples directory of the ndk (CD $ ndk/samples/Hello-JNI). Here we use the hello-JNI project as an example.
Then, enter $ ndk/ndk-build to compile.
Appears (
Gdbserver: [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup: libs/armeabi/GDB. Setup
Install: libhello-jni.so => libs/armeabi/libhello-jni.so
)
Congratulations! compilation successful
If not open awk.exe... is reported
You need to go to the ndk directory and find the prebuilt \ windows \ bindirectory. Then change awk.exe to any name.