1

Simple question: I know that the STL library is not provided inside the Android NDK. Otherwise, I would like to use containers like vector, deque and so on.

Does anyone know if equivalent objects exist for Android NDK or should I develop mine ?

Thanks!

razlebe
  • 7,134
  • 6
  • 42
  • 57
Sly
  • 2,105
  • 5
  • 22
  • 28

1 Answers1

2

You can use STLPort (http://www.stlport.org/), which contains all the STL classes and has been ported to Android. Please have a look at answer of another question at uSTL or STLPort for Android?

Community
  • 1
  • 1
Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
  • Thanks for your answer. They say that their library has been available in Android since Android 2.2 ("stlport.so is among system libraries shipped with Android 2.2."). Otherwise, my application must work with Android 1.5 and later. Is it possible to fully embed this library in the application not to be system version dependant? – Sly Jul 19 '11 at 14:51
  • 1
    This is quite simple indeed. More information in file /docs/CPLUSPLUS-SUPPORT.html. To sum up, I have only added the following string in my Application.mk : APP_STL := stlport_static In my case, I use the static library because one dynamic library use the STL. Then, in *.cpp #include std::vector myVector; NOTE: I haven't tested it on Android 1.x yet but it works on Android 2.3 – Sly Jul 20 '11 at 08:30