1、cygwin简介
Cygwin是许多软件的集合,最初由Cygnus Solutions开发,用于各种版本的Microsoft Windows上,运行UNIX类系统。Cygwin的主要目的是通过重新编译,将POSIX系统(例如Linux、BSD,以及其他Unix系统)上的软件移植到Windows上.
2、NDK和cygwin
由于NDK编译代码时必须要用到make和gcc,所以你必须先搭建一个linux环境, cygwin是一个在windows平台上运行的unix模拟环境,它对于学习unix/linux操作环境,或者从unix到windows的应用程序移植,非常有用。通过它,你就可以在不安装linux的情况下使用NDK来编译C、C++代码了。
3.r7版本以上NDK可以不使用cygwin
http://www.kandroid.org/ndk/docs/CHANGES.html
http://developer.android.com/tools/sdk/ndk/index.html#Revisions
You can now build your NDK sources on Windows *without* Cygwin. Simply call the script 'ndk-build.cmd' from the Windows cmd.exe command-line, when in your project path. The script takes exactly the same arguments than the original ndk-build one.
Note that the Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other tools required by the build, i.e. you shouldn't need to install anything else to get a working build system.
IMPORTANT: ndk-gdb doesn't work. You still need Cygwin to debug at the moment! This feature is still very experimental, but feel free to try it and report issues on the public forum (android-ndk@googlegroups.com) or the public bug databse (http://b.android.com). Note that all samples and unit tests succesfully compile with it.