Hello there,
I've seen multiple threads but none have solved my issue so here I am.
I've installed all of the necessary Android development tools and I've built and installed the most recent SFML using CMake. SFML and its headers are in the AndroidNDK source folder after the install as they should be.
I then change directory to the example and perform
android update project --target 1 --path . --name SFML-Example which updates perfectly.
I then do "ndk-build" which outputs:
[armeabi-v7a] Prebuilt : libsfml-activity.so <= <NDK>/sources/sfml/lib/armeabi-v7a/
[armeabi-v7a] Install : libsfml-activity.so => libs/armeabi-v7a/libsfml-activity.so
[armeabi-v7a] Compile++ thumb: sfml-example <= main.cpp
[armeabi-v7a] Prebuilt : libsfml-graphics.so <= <NDK>/sources/sfml/lib/armeabi-v7a/
[armeabi-v7a] Prebuilt : libsfml-audio.so <= <NDK>/sources/sfml/lib/armeabi-v7a/
[armeabi-v7a] Prebuilt : libsfml-network.so <= <NDK>/sources/sfml/lib/armeabi-v7a/
[armeabi-v7a] Prebuilt : libc++_shared.so <= <NDK>/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/
[armeabi-v7a] Prebuilt : libsfml-window.so <= <NDK>/sources/sfml/lib/armeabi-v7a/
[armeabi-v7a] Prebuilt : libsfml-system.so <= <NDK>/sources/sfml/lib/armeabi-v7a/
[armeabi-v7a] SharedLibrary : libsfml-example.so
jni/main.cpp:79: error: undefined reference to 'sf::String::String(char const*, std::__ndk1::locale const&)'
jni/main.cpp:82: error: undefined reference to 'sf::Texture::loadFromFile(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, sf::Rect<int> const&)'
jni/main.cpp:90: error: undefined reference to 'sf::Music::openFromFile(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function ANativeActivity_onCreate: error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::rdbuf(std::basic_streambuf<char, std::char_traits<char> >*)'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::locale::~locale()'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'vtable for std::basic_streambuf<char, std::char_traits<char> >'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
collect2.exe: error: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libsfml-example.so] Error 1
However, if I change the application make file for the example to be "APP_STL := stlport_shared" it then becomes:
[armeabi-v7a] Install : libsfml-activity.so => libs/armeabi-v7a/libsfml-activity.so
[armeabi-v7a] Compile++ thumb: sfml-example <= main.cpp
[armeabi-v7a] Prebuilt : libstlport_shared.so <= <NDK>/sources/cxx-stl/stlport/libs/armeabi-v7a/
[armeabi-v7a] SharedLibrary : libsfml-example.so
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function ANativeActivity_onCreate: error: undefined reference to 'std::basic_ios<char, std::char_traits<char> >::rdbuf(std::basic_streambuf<char, std::char_traits<char> >*)'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
C:/MobileDev/AndroidDev/android-ndk-r12b/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
collect2.exe: error: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libsfml-example.so] Error 1
What exactly am I doing wrong for these 3 errors to persist? I believe all my environment variables are setup correctly but I have an inkling that may be where the error lies.