EclipseによるAndroid NDK コンパイルメモ
「端末の拡大があんまり大きくならないから拡大するアプリ作りたいだけ」
という理由でGLSLでバイキュービック法で拡大するカメラアプリ試作してみてるんだけど、保存が異常に遅くて。。。
GLってあれね、写真みたいなデッカイテクスチャ作れる機種って限られるしキツイね
いったん全部サーフェス破棄しないと確保できないので重いし、IntBufferもすげぇ重いし。
OpenCV使ってみようかなー
でもNDKのコンパイルって面倒くさいんだよなぁーー
と思ってたら最近は結構便利になった様子なのでちょっと構築してみることに。
↓だいたいはこちらで
Android NDKを使った開発環境の構築
http://note.chiebukuro.yahoo.co.jp/detail/n136598
↓おわったらこんなエラーが
Android NDK: Warning: APP_PLATFORM android-14 is larger than android:minSdkVersion 10 in ./AndroidManifest.xml
Function 'assert' could not be resolved ndksample.cpp /NDKSample/jni 行 9 Semantic Error
Method 'NewStringUTF' could not be resolved ndksample.cpp /NDKSample/jni 行 8 Semantic Error
Type 'jint' could not be resolved ndksample.hpp /NDKSample/jni 行 16 Semantic Error
Type 'JNICALL' could not be resolved ndksample.hpp /NDKSample/jni 行 15 Semantic Error
Type 'JNIEnv' could not be resolved ndksample.hpp /NDKSample/jni 行 16 Semantic Error
Type 'jobject' could not be resolved ndksample.hpp /NDKSample/jni 行 16 Semantic Error
Type 'JNICALL' could not be resolved ndksample.cpp /NDKSample/jni 行 5 Semantic Error
Type 'JNIEnv' could not be resolved ndksample.cpp /NDKSample/jni 行 6 Semantic Error
Type 'jobject' could not be resolved ndksample.cpp /NDKSample/jni 行 6 Semantic Error
Type 'jint' could not be resolved ndksample.cpp /NDKSample/jni 行 6 Semantic Error
Type 'jstring' could not be resolved ndksample.cpp /NDKSample/jni 行 8 Semantic Error
とりあえず上から順に対処。
↓このエラーは
Android NDK: Warning: APP_PLATFORM android-14 is larger than android:minSdkVersion 10 in ./AndroidManifest.xml
・Application.mk を作成し、以下を記述。
APP_PLATFORM := android-10
対処すると以下の2つを残してエラーが消えます。
Function 'assert' could not be resolved ndksample.cpp /NDKSample/jni 行 9 Semantic Error
Type 'JNICALL' could not be resolved ndksample.hpp /NDKSample/jni 行 15 Semantic Error
で、対処法は、
・Eclipseのメニューから
[プロジェクト]→[プロパティ]→[C/C++ 一般]→[インデクサー]
「エディターで開かれたソースおよびヘッダー・ファイルをインデックス」にチェック
結構ハマりました(´・ω・`)ノシ