Issue
We have an Android application with several native libraries. Currently, most of them use stlport_shared
, but we are interested in upgrading to c++_shared
(the LLVM libc++ runtime). If we were to upgrade some of them, but not others, we would have to load both stlport and llvm.
I imagined that loading two implementations of the STL might cause issues, but in practice the app seems to run correctly. Is this undefined behavior, or is it allowable to load more than one STL implementation?
I've read over https://developer.android.com/ndk/guides/cpp-support.html and some of the documentation supplied with the NDK, but can't seem to find a definitive answer. Thank you for your help!
Solution
It's best to avoid this if at all possible.
If an STL type (like a std::string
, for example) is accessed by both an stlport_shared
binary and a c++_static
binary, as the two implementations of std::string
are not compatible this will not work.
You also are vulnerable to the issues described by https://stackoverflow.com/a/25856207/632035
Answered By - Dan Albert
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.