Android NDK安裝設定

來源:互聯網
上載者:User

Android NDK 基本就是 Linux的開發,不過主要是產生.so形式供SDK調用。涉及的工具,就是Linux開發工具+SDK介面組件

 

建立 NDK 編譯環境

1. 下載android NDK r4 Windows 安裝包,解壓縮到你想放的位置,如d:/android

2. 安裝較新版本的cygwin,安裝中需要選擇安裝的Linux相關組件,主要是make、gcc、g++工具

3. 運行cygwin, 設定檔.bash_profile中添加環境變數 NDK=/cygdrive/d/android/android-ndk-r4; export NDK 。Windows的環境變數PATH 裡面設定該路徑

4.進入android-ndk-r4/sample中例子,如hello-jni,運行ndk-build,進行編譯,結果是libxxx.so,成功說明編譯環境搭建好了。、

 

 Eclipse NDK設定:

1. Eclipse中開啟sample中的工程,具體操作是:建立android工程->從原始碼建立。這時候可以編譯java工程

2. 設定 NDK編譯選項,調用cygwin編譯工具,完成後重新整理相關檔案(主要是libxxx.so),設定方法參考:
http://www.360doc.com/content/11/0223/17/2734308_95473676.shtml

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.