Porting a C++ application to android

我们两清 提交于 2019-12-09 16:31:59

问题


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?

UPDATE: Ndk Revision 5 promises a default STL implementation based on STLport. http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html Read this official NDK blog post, http://developer.android.com/sdk/ndk/index.html>and the revision notes.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2725997/porting-a-c-application-to-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!