Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Can't compile SFML for Android on Linux  (Read 3786 times)

0 Members and 1 Guest are viewing this topic.

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Can't compile SFML for Android on Linux
« 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.

cvkfak

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Can't compile SFML for Android on Linux
« Reply #1 on: February 12, 2017, 10:01:27 am »
Use stlport_shared, something like this
cmake -DANDROID_STL=stlport_shared  "OTHER THINGS..."

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: Can't compile SFML for Android on Linux
« Reply #2 on: February 12, 2017, 10:09:20 am »
Thanks!
It worked!!

I've added that to SFML wiki.

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: Can't compile SFML for Android on Linux
« Reply #3 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)

cvkfak

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Can't compile SFML for Android on Linux
« Reply #4 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

amhndu

  • Newbie
  • *
  • Posts: 42
  • Err, err and err again, but less, less and less
    • View Profile
    • amhndu.github.io
    • Email
Re: Can't compile SFML for Android on Linux
« Reply #5 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 ?

cvkfak

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Can't compile SFML for Android on Linux
« Reply #6 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?