.
要在Ubuntu 9.10 / Linux Mint 8 下安裝Linux版的Android NDK
若用此兩版裝ndk,會遇到問題
正常的安裝步驟:
1.首先要將將ndk解壓縮:
$ unzip android-ndk-1.5_r1-linux-x86.zip
2.解完後的目錄為android-ndk-1.5_r1 ,則切換到該目錄:
$ cd android-ndk-1.5_r1
3.接著要在解壓縮後的目錄下執行./build/host-setup.sh:
$ ./build/host-setup.sh:
接著就會遇到問題:
./build/host-setup.sh: 23: source: not found
Detecting host toolchain.
./build/host-setup.sh: 57: force_32bit_binaries: not found
./build/host-setup.sh: 58: setup_toolchain: not found
./build/host-setup.sh: 60: cannot create : Directory nonexistent
Can't create directory for host config file: out/host
如下圖:
解法為用文字編輯器(eg. vi)修改./build/host-setup.sh中的第一行,將#!/bin/sh改為#!/bin/bash後,存檔,再執行一次./build/host-setup.sh,即可安裝成功
gdemon@gdemon-ubuntu910:~/android-ndk-1.5_r1$ vim ./build/host-setup.sh
gdemon@gdemon-ubuntu910:~/android-ndk-1.5_r1$ ./build/host-setup.sh
Detecting host toolchain.
CC : compiler check ok (gcc)
LD : linker check ok (gcc)
CXX : C++ compiler check ok (g++)
Generate : out/host/config.mk
Toolchain : Checking for arm-eabi-4.2.1 prebuilt binaries
Host setup complete. Please read docs/OVERVIEW.TXT if you don't know what to do.
如下圖:
接著make在samples裡的例子:
$ make APP=hello-jni
然後prompt就會提示你編譯so成功,並安裝到apps/hello-jni/project/libs/armeabi/中
如下圖:
在Ubuntu 9.10 / Linux Mint 8下我都試過有這問題,也都是這樣就可以安裝成功了
.
2010年1月22日 星期五
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言