SFML community forums

General => General discussions => Topic started by: OmaManfred on January 26, 2017, 11:48:06 am

Title: [Solution] #include <ostream> No such file or directory | Android Build SFML
Post by: OmaManfred on January 26, 2017, 11:48:06 am
Hey, just wanted to give you a possible "bug fix", because I saw some other people having the same issue in the past. If "make"ing your android makefiles returns an error "#include <ostream> No such file or directory", try switiching your NDK to version 12b. With that one it worked fine (not with 13b though, the currently newest one)

Best wishes,
Title: Re: [Solution] #include <ostream> No such file or directory | Android Build SFML
Post by: rumgot on February 10, 2017, 11:03:41 am
Build SFML-library not so:
cmake -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..

But like this:
cmake -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake -DANDROID_STL=stlport_static ../..

Or this:
cmake -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake -DANDROID_STL=stlport_shared ../..

Allowed values for the parameter ANDROID_STL can be seen in the file
<SFML_DIRECTORY>/cmake/toolchains/android.toolchain.cmake

These steps I checked on SFML-2.4.1.
Title: Re: [Solution] #include <ostream> No such file or directory | Android Build SFML
Post by: rumgot on February 10, 2017, 11:52:25 am
But later, when I executed a command
ndk-build
I got an error:
undefined reference to 'sf::String::String(char const*, std::__ndk1::locale const&)'
So while I will use android-ndk-r12b.
Title: Re: [Solution] #include <ostream> No such file or directory | Android Build SFML
Post by: 4r4r on March 11, 2017, 05:42:32 am
in your ..\jni\Android.mk
replace
include $(BUILD_SHARED_LIBRARY)
with
include $(BUILD_STATIC_LIBRARY)