views:

602

answers:

2

Is it possible to port a C++ application which uses the STL extensively to Android? I understand that currently the NDK does not support this, but is there any effort (open source or otherwise) underway to achieve this?

If not is there a way to cross compile libstdc++ for Android?

A: 

You could always implement what you need yourself. The STL is only written using the CRT, OS headers and standard C++. It would depend on what you need done.

DeadMG
+4  A: 

You may want to start with Dmitry Moskalchuk's modified version of the NDK (includes support for exceptions, RTTI, and the standard c++ library). Keep in mind that if you go down this path your application's size will be larger as you will be statically linking a c++ library into it. Also, this thread from the andriod-ndk group may give better direction on how to incorporate the STL.

Tim Kryger
That is a trade off which I am willing to make for this particular use case. This looks quite promising.
vivekian2
Let me know how you get on :)
Donal Rafferty
Donal: It does not look too good. Seeing seg faults while doing push_back on vector elements. Have you tried this yet?
vivekian2