Hello!
I've been trying all day to compile SFML for android and i have been following this guide:
https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-AndroidSo far I've made it to actually building the android example by calling 'ndk-build'.
However when I do, i get a load of errors. It seems to start out well and then fails when it reaches a shared
library in main.cpp. I can't make any sense of what it's looking for that isn't there and when i should have created that object.
Here are my errors, can any of you brilliant people infer from this what i might have done wrong?
EDIT: I have circumvented this issue by changing this line in my Application.mk:
APP_STL := gnustl_shared (instead of c++shared)
C:\Androidstuff\SFML\examples\android>ndk-build -B
[armeabi-v7a] Prebuilt : libsfml-activity.so <= <NDK>/sources/sfml/lib/arm
eabi-v7a/
[armeabi-v7a] Install : libsfml-activity.so => libs/armeabi-v7a/libsfml-a
ctivity.so
[armeabi-v7a] Compile++ thumb: sfml-example <= main.cpp
[armeabi-v7a] Prebuilt : libsfml-graphics.so <= <NDK>/sources/sfml/lib/arm
eabi-v7a/
[armeabi-v7a] Prebuilt : libsfml-audio.so <= <NDK>/sources/sfml/lib/armeab
i-v7a/
[armeabi-v7a] Prebuilt : libsfml-network.so <= <NDK>/sources/sfml/lib/arme
abi-v7a/
[armeabi-v7a] Prebuilt : libc++_shared.so <= <NDK>/sources/cxx-stl/llvm-li
bc++/libs/armeabi-v7a/thumb/
[armeabi-v7a] Prebuilt : libsfml-window.so <= <NDK>/sources/sfml/lib/armea
bi-v7a/
[armeabi-v7a] Prebuilt : libsfml-system.so <= <NDK>/sources/sfml/lib/armea
bi-v7a/
[armeabi-v7a] SharedLibrary : libsfml-example.so
jni/main.cpp:10: error: undefined reference to 'sf::String::String(char const*,
std::__1::locale const&)'
jni/main.cpp:13: error: undefined reference to 'sf::Texture::loadFromFile(std::_
_1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >
const&, sf::Rect<int> const&)'
jni/main.cpp:21: error: undefined reference to 'sf::Music::openFromFile(std::__1
::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > co
nst&)'
C:/Androidstuff/android-ndk-r10e/sources/sfml/lib/armeabi-v7a/libsfml-main.a(Mai
nAndroid.o):MainAndroid.cpp:function ANativeActivity_onCreate: error: undefined
reference to 'std::basic_ios<char, std::char_traits<char> >::rdbuf(std::basic_st
reambuf<char, std::char_traits<char> >*)'
C:/Androidstuff/android-ndk-r10e/sources/sfml/lib/armeabi-v7a/libsfml-main.a(Mai
nAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefin
ed reference to 'std::locale::~locale()'
C:/Androidstuff/android-ndk-r10e/sources/sfml/lib/armeabi-v7a/libsfml-main.a(Mai
nAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefin
ed reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
C:/Androidstuff/android-ndk-r10e/sources/sfml/lib/armeabi-v7a/libsfml-main.a(Mai
nAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefin
ed reference to 'std::string::_Rep::_S_empty_rep_storage'
C:/Androidstuff/android-ndk-r10e/sources/sfml/lib/armeabi-v7a/libsfml-main.a(Mai
nAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefin
ed reference to 'vtable for std::basic_streambuf<char, std::char_traits<char> >'
C:/Androidstuff/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/w
indows/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideab
i/bin/ld.exe: the vtable symbol may be undefined because the class is missing it
s key function
collect2.exe: error: ld returned 1 exit status
make.exe: *** [obj/local/armeabi-v7a/libsfml-example.so] Error 1
C:\Androidstuff\SFML\examples\android>