It seems like by default UE4 chooses stlport. Unfortunately stlport does not support the C++11 features of the stdlib. So to be able to link against 3rd party libraries that use C++ 11 stdlib features we need to choose the LLVM libc++ runtime.
Interestingly is has worked back when our 3rd party lib wasn’t using C++ 11 stdlib features and was using stlport.
However gnustl is licensed under the GPLv3, so doesn’t UE4 using a GPLv3 standardlib force all your customers to release their games under the GPLv3 themselves?
I created a simple external library with no c++11 code and I am able to link that in correctly to an Android project.
However, as soon as I add in some c++11 code, even some std::string related code, the linking fails giving me errors which curiously look like a c++11 related problem
This is what I get as soon as I include a function returning std::string in the external library.
Oh, I remember the sleepless nights when trying to make 3rd party static libraries work… To make it work all of my projects have Application.mk with such settings:
The latest version of Android Studio seems to support CMake builds instead of ndk builds hence I can’t seem to use the Application.mk file. Should I be using an older version for this?
Basically the issue I am facing is that I am not able to create a static library using the CMake build system by specifying STATIC keyword in the add_library command. It only wants to create shared libraries.
EDIT
Nevermind, I was able to generate a static library now. Thanks.
darkZ, can you please elaborate how did you do that? Where is Application.mk file? Or where should it be created? Any documentation links or explanation how should c++11 compilation be enabled for Android packaging will be much appreciated.
P.S.
I am trying to package “game” in UE4.16.2 with elements of c++11 in the code, and so far it seems to be no way at all. Please prove me wrong.