PlaygroundOSSとの戦い(2)

こちらでまとめてます。

PlaygroundOSSを使ってAndroidのアプリ作成 - mizukisonoko’s diary

前回のブログ記事\デェン/

動かなかった

今回の内容

動いた

エラーを読む

~$ ndk-build
find: ./jni/custom: No such file or directory
Android NDK: WARNING:jni/Android.mk:Game: non-system libraries in linker flags: -lcurl -lfreetype2    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
find: ./jni/custom: No such file or directory
Android NDK: WARNING:jni/Android.mk:Game: non-system libraries in linker flags: -lcurl -lfreetype2    
Android NDK:     This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES    
Android NDK:     or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
Android NDK:     current module    
[x86] Compile++      : Game <= KLBPlatformMetrics.cpp
[x86] SharedLibrary  : libGame.so
[x86] Install        : libGame.so => libs/x86/libGame.so
[x86] Install        : libjniproxy.so => libs/x86/libjniproxy.so
[armeabi-v7a] Compile++ arm  : Game <= KLBPlatformMetrics.cpp
[armeabi-v7a] SharedLibrary  : libGame.so
{HOME}/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/objs/Game/./libs/Tremolo/dpen.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
{HOME}/ndk/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/objs/Game/./libs/Tremolo/mdctARM.o: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libGame.so] Error 1

[armeabi-v7a] Compile++ arm で死んでいるっぽい?

中に入ってみる

$ adb shell
shell@hammerhead:/ $ run-as klb.android.GameEngine
shell@hammerhead:/ $ ls lib/
libjniproxy.so

無いっぽい。終了

NDKをかえてみる

エラー文

 requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

をググってみたら以下のサイトを発見した。
CocoaChina 开发讨论区 最热的iOS开发论坛| 最热的Mac开发论坛 | 最热的iPhone开发论坛 | 最热的iPad开发论坛
もしやと思いr9をインストール
公式サイトにリンクがなさそうだったので

Old Versions of Android NDK - Stack Overflow
な形でr9dをインストール。export等を変更、ndk-buildする

結果

動いた

$ adb shell
shell@hammerhead:/ $ run-as klb.android.GameEngine
shell@hammerhead:/ $ ls lib/
libjniproxy.so
libGame.so

できてる。


後ほど動いた版の手順を書きます