Android NDKでerror: 'to_string' is not a member of 'std'
androidでC++のstd::to_stringを使うと以下のようなビルドエラーがでました。(環境:Android NDK r10d)
error: 'to_string' is not a member of 'std'
もちろんC++11の設定自体はできていて、他のstd::functionなどは問題なく使えます。
LOCAL_CFLAGS := -std=c++11
NDKのlibstdc++ではまだto_stringをサポートしてない?ぽいので自前で用意するしかなさそうな
template <typename T> std::string to_string(T value) { std::ostringstream os ; os << value ; return os.str() ; }
APP_STL を gnustl_staticではなく、stlport_staticにするとto_string使うことができましたが、C++ exception supportがない模様
The Developer's Guide | Android Developers