参考
http://www.metsky.com/archives/525.html
准备NDK
1、从 http://developer.android.com/sdk/ndk/index.html 下载
2、解压(我解压到了以下目录,切记, 目录名里不能有空格)
安装Cygwin
参见 http://blog.csdn.net/zz962/article/details/6895927
为Cygwin设置NDK
1、到cygwin的安装目录下,找到home文件夹,进入以自己用户名(此处为A)命名的文件夹,找到.bash_profile(这些文件必须要启动过Cygwin bash shell后才会生成,如图)
2、用VIM打开,在结尾增加以下内容(通常情况,先按o插入一行,然后键入以下红框内容)
3、重启动Cygwin,输入cd $NDK,结果应为以下
编译
进入到代码目录编译,最终结果如下
1、进入代码目录
2、键入命令“$NDK/ndk-build”来编译,最终产生so文件
以上表示编译成功
http://www.metsky.com/archives/525.html
准备NDK
1、从 http://developer.android.com/sdk/ndk/index.html 下载
2、解压(我解压到了以下目录,切记, 目录名里不能有空格)
![](http://hi.csdn.net/attachment/201110/22/0_13192633906xeQ.gif)
安装Cygwin
参见 http://blog.csdn.net/zz962/article/details/6895927
为Cygwin设置NDK
1、到cygwin的安装目录下,找到home文件夹,进入以自己用户名(此处为A)命名的文件夹,找到.bash_profile(这些文件必须要启动过Cygwin bash shell后才会生成,如图)
![](http://hi.csdn.net/attachment/201111/16/0_13214528272jIN.gif)
![](http://hi.csdn.net/attachment/201110/22/0_13192622992190.gif)
2、用VIM打开,在结尾增加以下内容(通常情况,先按o插入一行,然后键入以下红框内容)
![](http://hi.csdn.net/attachment/201110/22/0_1319263772x1Cx.gif)
3、重启动Cygwin,输入cd $NDK,结果应为以下
![](http://hi.csdn.net/attachment/201110/22/0_1319263673pcp3.gif)
编译
进入到代码目录编译,最终结果如下
1、进入代码目录
2、键入命令“$NDK/ndk-build”来编译,最终产生so文件
![](http://hi.csdn.net/attachment/201110/22/0_1319264199QrBd.gif)
以上表示编译成功