NDK編譯C/C++檔案
1. android ndk + CDT
Window --> Preference --> Android --> NDK --> NKD Location 配置D:\Android\android-ndk-r9d
C/C++ --> Debug --> Source Lookup path --> Path Mappging 配置 \cygdrive\d d:\
C/C+= --> New CDT Project Wizard --> Makefile Project --> Binary Parsers --> 勾選 PEWindows Parser
勾選Cygwind PE Parser
android-ndk-r7以上的版本,不再依賴cygwin,直接進入C檔案目錄(cmd)執行ndk-build, 編譯生成so,
經驗證不用配置C/C++ --> Debug和C/C+= --> New CDT Project Wizard
2. C/C++專案 CDT + cygwin
Window --> Preference --> Android --> NDK --> NKD Location 配置D:\Android\android-ndk-r9d
C/C++ --> Debug --> Source Lookup path --> Path Mappging 配置 \cygdrive\d d:\
C/C+= --> New CDT Project Wizard --> Makefile Project --> Binary Parsers --> 勾選 PEWindows Parser
勾選Cygwind PE Parser點選工程 --> Project --> Build Project 生成so檔案
3.android ndk +cdt + cygwin
配置cygwin\home\<使用者名稱>\.basth_profile
NDK=/cygdrive/碟符/Android/android-ndk-r9d
export NDK
然後執行cygwin,進入專案目錄 cd /cygdrive/碟符/Android/android-ndk-r9d/samples/hello-jni
輸入命令 $NDK/ndk-build生成so