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 ([email protected]) or the public bug databse (http://b.android.com). Note that all samples and unit tests succesfully compile with it.