用于移动应用程序开发的 C++ 跨平台框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23837529/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C++ cross-platform framework for mobile app development
提问by John
I'm planning on developing mobile application for both iOS and Android and I want to use C++ for the development.
我计划为 iOS 和 Android 开发移动应用程序,我想使用 C++ 进行开发。
Which cross-platform framework is available for building mobile application using the C++ language.
哪个跨平台框架可用于使用 C++ 语言构建移动应用程序。
回答by JMRC
I'm sure a lot of people have this question as well, so read this if you'd really like to know the answer. Marmaladeis probably the BEST solution. Code once, deploy to mobile devices, desktops, even some TV's. Many popular games have been created with Marmalade.
我相信很多人也有这个问题,所以如果你真的想知道答案,请阅读本文。果酱可能是最好的解决方案。一次编码,部署到移动设备、台式机,甚至一些电视。许多流行的游戏都是用 Marmalade 创建的。
Extensive games like:
广泛的游戏,如:
Lara Croft and the Guardian of Light
Call of Duty: World at War Zombies
劳拉与光之守护者
使命召唤:War世界僵尸
But also simple games like:
但也有一些简单的游戏,例如:
draw something.
Doodle Jump
画一些东西。
涂鸦跳跃
They've added a free package. You can create your game for free and if you want to get rid of the ad splash screen, it's $150,- per year for mobile devices or $500,- per year for other devices as well.
他们添加了一个免费包。你可以免费创建你的游戏,如果你想摆脱广告启动画面,那就是每年 150 美元,用于移动设备或 500 美元,- 每年 也适用于其他设备.
A big advantage is the native speed. It doesn't matter what people claim about other languages like javascript or java (and unfortunately Qt, which of course isn't a language but you know what I mean) running as fast as C or C++. It's simply not true. For simple applications this is of course not important, but when you're looking at (simple) games, this is crucial.
一个很大的优势是原生速度。人们对 javascript 或 java(不幸的是 Qt,这当然不是一种语言,但您知道我的意思)等其他语言的声明与 C 或 C++ 的运行速度一样快并不重要。这根本不是真的。对于简单的应用程序,这当然不重要,但是当您查看(简单的)游戏时,这很重要。
At the moment version 7.3 is available, but this version has a problem with the ARM emulator. I would download 7.0.
目前版本 7.3 可用,但此版本在 ARM 模拟器上存在问题。我会下载7.0。
Whether you choose Marmalade or not, make sure you read the documentation. You don't want to end up missing some functionality and switch to another option when you're almost finished.
无论您是否选择 Marmalade,请务必阅读文档。您不希望最终错过某些功能并在即将完成时切换到另一个选项。
回答by JMRC
I've looked into portable code between Android and iOS before and I don't think it's possible. To release apps into the Android market it needs to be in Java, and anything with a GUI on iOS needs to use Objective-C. You might be able to have partial portable C++ layer, but in reality it's probably quicker to write the same app twice in Java and Obj-C than it would be to write it once in C++ as a portable solution.
我之前研究过 Android 和 iOS 之间的可移植代码,但我认为这是不可能的。要将应用程序发布到 Android 市场,它需要使用 Java,而任何在 iOS 上带有 GUI 的东西都需要使用 Objective-C。您可能可以拥有部分可移植的 C++ 层,但实际上,用 Java 和 Obj-C 编写两次相同的应用程序可能比用 C++ 编写一次作为可移植解决方案更快。
Qt or Wx-Widgets might have some support, but I have not looked into mobile platforms for these, and I suspect the reality is that Apple, Microsoft and Oracle want you to be tied into their technologies these days and have no incentive to make things portable.
Qt 或 Wx-Widgets 可能有一些支持,但我没有研究过这些移动平台,我怀疑现实情况是 Apple、Microsoft 和 Oracle 现在希望你被他们的技术束缚住,而没有动力去做事情便携的。
EDIT: I noticed a recent down vote, but the person was not willing to leave a comment, so let me explain further. C# and Java provide a complete framework that allows code to be written much quicker using well documented classes and libraries, especially when dealing with user interfaces. C++ on the other hand relies on many open source projects that take a lot of effort to get functioning on multiple platforms, and much time is spent dealing with subtle platform problems. My suggestion was simply that it might be easier to pick a language better suited to the platform you are dealing with, as C++ tends to be lower level than other languages, the syntax can seem verbose and many hours can be wasted trying to make things work that you would expect to just work, and unfortunately documentation for many open source projects is poor. Maybe this can be considered to be an opinion, but then the shift from C++ to C# or Java commercially might also indicate that I'm not the only one believing this.
编辑:我注意到最近投反对票,但该人不愿意发表评论,所以让我进一步解释一下。C# 和 Java 提供了一个完整的框架,允许使用记录良好的类和库更快地编写代码,尤其是在处理用户界面时。另一方面,C++ 依赖于许多开源项目,这些项目需要花费大量精力才能在多个平台上运行,并且花费大量时间处理微妙的平台问题。我的建议很简单,选择一种更适合您正在处理的平台的语言可能会更容易,因为 C++ 的级别往往低于其他语言,语法可能看起来很冗长,并且可能会浪费很多时间来尝试使事情正常工作你会期望它只是工作,不幸的是,许多开源项目的文档很差。
回答by Robert Webb
There ARE solutions for C++ cross-platform development for Android and iPhone, despite what other answers say here.
尽管这里有其他答案,但仍有适用于 Android 和 iPhone 的 C++ 跨平台开发解决方案。
The best is probably Marmalade, but it's expensive, so only useful for commercially viable apps: https://www.madewithmarmalade.com/
最好的可能是果酱,但它很贵,所以只对商业上可行的应用程序有用:https: //www.madewithmarmalade.com/
Then there's MoSync, which you can use for free. Unfortunately they went bankrupt last year, so there's no ongoing support. Still, might be worth a look depending on your needs. http://www.mosync.com
然后是 MoSync,您可以免费使用。不幸的是,他们去年破产了,所以没有持续的支持。不过,根据您的需要,可能值得一看。 http://www.mosync.com
OpenFrameworks is one I hadn't seen, so thanks Rodrigo for that answer: http://openframeworks.cc/
OpenFrameworks 是我从未见过的,所以感谢 Rodrigo 的回答:http: //openframeworks.cc/
回答by Rodrigo Oliveira
You can take a look on openFrameworks, maybe it fits on your needs:
你可以看看 openFrameworks ,也许它符合你的需求:
回答by Brickyenne
Look for the DragonFire SDKit allows you to write apps and games in c/c++. Not cross-platform and never used it but looks good. It uses Visual Studio and has its own simulator for iOS development.
寻找DragonFire SDK,它允许您用 c/c++ 编写应用程序和游戏。不是跨平台的,从未使用过,但看起来不错。它使用 Visual Studio 并拥有自己的 iOS 开发模拟器。
回答by Steve M
There is no cross platform solution using C++, unless you're interested in making games. There are a few options available if you don't mind using another programming language. Take a look at Titanium SDK (Javascript), Xamarin (C#) or the multitude of HTML5/CSS/Javascript frameworks (Phonegap comes to mind).
除非您对制作游戏感兴趣,否则没有使用 C++ 的跨平台解决方案。如果您不介意使用另一种编程语言,有几个选项可用。看看 Titanium SDK (Javascript)、Xamarin (C#) 或众多的 HTML5/CSS/Javascript 框架(想到了 Phonegap)。