简体   繁体   English

将C ++应用程序移植到android

[英]Porting a C++ application to android

Is it possible to port a C++ application which uses the STL extensively to Android? 是否可以将使用STL的C ++应用程序移植到Android? I understand that currently the NDK does not support this, but is there any effort (open source or otherwise) underway to achieve this? 我知道目前NDK不支持这一点,但有没有努力(开源或其他方面)正在实现这一目标?

If not is there a way to cross compile libstdc++ for Android? 如果没有,有没有办法跨Android编译libstdc ++?

UPDATE: Ndk Revision 5 promises a default STL implementation based on STLport. 更新:Ndk Revision 5承诺基于STLport的默认STL实现。 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. http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html 阅读此官方NDK博客文章 ,http://developer.android.com/sdk/ndk/index.html>和修订说明。

You may want to start with Dmitry Moskalchuk's modified version of the NDK (includes support for exceptions, RTTI, and the standard c++ library). 您可能想要从Dmitry Moskalchuk的NDK修改版本开始(包括对异常,RTTI和标准c ++库的支持)。 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. 请记住,如果沿着这条路走下去,你的应用程序的大小会更大,因为你将静态地将c ++库链接到它中。 Also, this thread from the andriod-ndk group may give better direction on how to incorporate the STL. 此外,来自andriod-ndk组的这个线程可以为如何合并STL提供更好的指导。

You could always implement what you need yourself. 你总是可以自己实现你需要的东西。 The STL is only written using the CRT, OS headers and standard C++. STL仅使用CRT,OS头和标准C ++编写。 It would depend on what you need done. 这取决于你需要做什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM