简体   繁体   English

使用C还是C ++进行跨平台的移动开发?

[英]C or C++ for cross-platform mobile development?

For a cross-platform project on iOS, Android and Windows I originally wrote some underlying classes in C++. 对于iOS,Android和Windows上的跨平台项目,我最初使用C ++编写了一些基础类。 From what I understand however, I will have to write an objective-C wrapper to allow the swift iPhone project to work in xcode. 但是据我了解,我将不得不编写一个Objective-C包装程序,以使迅速的iPhone项目可以在xcode中运行。 Would it make more sense then that I simply rewrite all of the original framework in C or would simply wrapping it in C be a better solution. 那么,使我仅用C重写所有原始框架还是将其包装在C中是一个更好的解决方案,是否更有意义? No problem either way just attempting to determine the best way to keep the code valid. 尝试尝试确定保持代码有效的最佳方法都没有问题。

Also telling me to use a cross-platform mobile development SDK is not helpful. 告诉我使用跨平台移动开发SDK也无济于事。

I would recommend writing in C++ 11. It's more modern, has more support online, and you can even compile everything with Cmake. 我建议用C ++ 11编写。它更现代,在网上有更多支持,您甚至可以使用Cmake进行编译。 There are many tools out there to help you with this. 有很多工具可以帮助您。 My company is using this to develop a framework that compiles on the following platforms: 我的公司正在使用它来开发可在以下平台上编译的框架:

iOS, Mac OS X, Android (ARM, x86, x64), Windows (x86, x64), Linux (x86, x64) iOS,Mac OS X,Android(ARM,x86,x64),Windows(x86,x64),Linux(x86,x64)

You can also find a tool here to help you with cross platform toolchains, so that code you compile is easily ready for multiple platforms: https://github.com/ruslo/polly 您还可以在这里找到一个工具来帮助您跨平台的工具链,以便您编译的代码可以轻松地用于多个平台: https : //github.com/ruslo/polly

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

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