SFML community forums

Help => General => Topic started by: amhndu on February 10, 2017, 01:22:49 pm

Title: Can't compile SFML for Android on Linux
Post by: amhndu on February 10, 2017, 01:22:49 pm
Trying to follow this tutorial: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android

I've installed Android Studio with Android SDK (the latest stable), then from the SDK Manager, installed the NDK (version 13).
I've accordingly set my PATH to include the android sdk/tools, sdk/platform-tools and the ndk it had downloaded and set ANDROID_NDK accordingly too.

Then executing the cmake command on the wiki gives me this error:
(click to show/hide)

I've tried this both with SFML 2.3.2 and SFML github snapshot.

My system: Ubuntu 16.04

I even found a forum post with someone having similar problem (http://en.sfml-dev.org/forums/index.php?topic=16033.0) but OP's case was solved when they switched to NDK 10 from 9 but I'm using 13, a much newer version.
Title: Re: Can't compile SFML for Android on Linux
Post by: cvkfak on February 12, 2017, 10:01:27 am
Use stlport_shared, something like this
cmake -DANDROID_STL=stlport_shared  "OTHER THINGS..."
Title: Re: Can't compile SFML for Android on Linux
Post by: amhndu on February 12, 2017, 10:09:20 am
Thanks!
It worked!!

I've added that to SFML wiki.
Title: Re: Can't compile SFML for Android on Linux
Post by: amhndu on February 12, 2017, 10:17:03 am
Now I'm getting linker errors when trying to compile the example.
It is this same issue: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android#stl-clash
But the resolution provided is to use: "-DANDROID_STL=c++_shared" but if I do that, SFML doesn't compile at all.

(click to show/hide)
Title: Re: Can't compile SFML for Android on Linux
Post by: cvkfak on February 12, 2017, 10:19:06 am
Oh im sorry, i forgoted that:
In the code example -> jni -> aplication.mk
APP_STL := stlport_shared

Sorry my bad english
Title: Re: Can't compile SFML for Android on Linux
Post by: amhndu on February 12, 2017, 10:44:54 am
Thanks!
I was able to compile and run the example app.

Is this only a problem with Linux systems ?
Otherwise why isn't stlport_shared the default ?
Title: Re: Can't compile SFML for Android on Linux
Post by: cvkfak on February 13, 2017, 03:45:16 am
Is this only a problem with Linux systems ?
i think so, not sure.

Otherwise why isn't stlport_shared the default ?
could you please make a pull request?