I've been battling to get Cpp programs on Android for a few days now, and I've ran into a problem what I think might be a bug. I'm using SDL2 but no other libraries, also I'm using the SDL android project template.
Basic programs run fine, but I would want to use Cpp stdlibs and STL, so according to instructions, I added APP_STL := stlport_static to Application.mk and rebuilt the program but after this the app just shows a blank screen for a while and then crashes, debug says following:
01-20 22:10:14.817: D/dalvikvm(26097): Trying to load lib /data/data/com.kebabkeisari.peli/lib/libSDL2.so 0x41d06890
01-20 22:10:14.817: W/dalvikvm(26097): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/libsdl/app/SDLActivity;
01-20 22:10:14.817: W/dalvikvm(26097): Class init failed in newInstance call (Lcom/kebabkeisari/peli/Ribale;)
01-20 22:10:14.822: D/AndroidRuntime(26097): Shutting down VM
01-20 22:10:14.822: W/dalvikvm(26097): threadid=1: thread exiting with uncaught exception (group=0x4109f2a0)
01-20 22:10:14.827: E/AndroidRuntime(26097): FATAL EXCEPTION: main
01-20 22:10:14.827: E/AndroidRuntime(26097): java.lang.ExceptionInInitializerError
01-20 22:10:14.827: E/AndroidRuntime(26097): at java.lang.Class.newInstanceImpl(Native Method)
01-20 22:10:14.827: E/AndroidRuntime(26097): at java.lang.Class.newInstance(Class.java:1319)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.app.Instrumentation.newActivity(Instrumentation.java:1057)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.app.ActivityThread.access$600(ActivityThread.java:140)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.os.Handler.dispatchMessage(Handler.java:99)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.os.Looper.loop(Looper.java:137)
01-20 22:10:14.827: E/AndroidRuntime(26097): at android.app.ActivityThread.main(ActivityThread.java:4898)
01-20 22:10:14.827: E/AndroidRuntime(26097): at java.lang.reflect.Method.invokeNative(Native Method)
01-20 22:10:14.827: E/AndroidRuntime(26097): at java.lang.reflect.Method.invoke(Method.java:511)
01-20 22:10:14.827: E/AndroidRuntime(26097): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
01-20 22:10:14.827: E/AndroidRuntime(26097): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
01-20 22:10:14.827: E/AndroidRuntime(26097): at dalvik.system.NativeStart.main(Native Method)
01-20 22:10:14.827: E/AndroidRuntime(26097): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1307]: 1951 cannot locate 'signal'...
01-20 22:10:14.827: E/AndroidRuntime(26097): at java.lang.Runtime.loadLibrary(Runtime.java:370)
01-20 22:10:14.827: E/AndroidRuntime(26097): at java.lang.System.loadLibrary(System.java:535)
01-20 22:10:14.827: E/AndroidRuntime(26097): at org.libsdl.app.SDLActivity.<clinit>(SDLActivity.java:49)
01-20 22:10:14.827: E/AndroidRuntime(26097): ... 15 more
So the program fails linking at runtime. STL is the culprit and yes, I have tried gnustl and others but the same problem occurs.
I'm using ndk-build and Eclipse, running apps on Samsung Galaxy S3.
I searched the net and there's indeed a ton of similiar problems, one place said to not build into armeabi and armeabi-v7 at the same time, but that did not help.