简体   繁体   English

将Windows C ++用于Android和iOS

[英]Using Windows C++ for Android and iOS

There is no way to bring my Windows C++ code over to both Android and iOS easily, isn't it? 无法将我的Windows C ++代码轻松地带到Android和iOS上,不是吗?

My C++ code is mainly only vectors, strings and such "light" stuff, it doesn't have anything to do with graphics. 我的C ++代码主要只是矢量,字符串和诸如此类的“轻”东西,它与图形无关。

I thought since C++ is kind of universal, there might be a tiny chance that I could somehow get it to work. 我以为,由于C ++具有通用性,因此我可能以某种方式使它起作用的可能性很小。

I guess C++ depends on the VS2010 C++ runtime, and therefore I have to write it completely anew, right? 我猜C ++取决于VS2010 C ++运行时,因此我必须重新编写它,对吗? Using XCode for iOS and Java for Android... 使用iOS的XCode和Android的Java ...

I guess that is so but perhaps somebody else is more up to date than I am. 我想是这样,但是也许其他人比我更及时。

Of course you can definitely bring your code over other platforms easily if you only have cross-platform and standard implementations. 当然,如果您只有跨平台和标准的实现,那么您绝对可以轻松地将代码带到其他平台上。 In order to port your code to Android you can look at JNI and for XCode you can just create Cocoa static libraries to be used in the objective-C++ projects 为了将您的代码移植到Android,您可以查看JNI,对于XCode,您可以仅创建要在Objective-C ++项目中使用的Cocoa静态库。

是的, 您可以编译适用于iOS 和Android的 C ++文件 ,但是您需要做一些本机的工作(目标C,Cocoa),以便使用迁移的C ++函数组装完整的代码签名的iOS应用,并且可能Android方面(利用Java)。

I was in this problem for quite a time ago and i found out that if you are going to write applications for ios , you must be knowing Objective C otherwise all the alternatives are just take you away from all the advantages and make your life harder... 我很早以前就遇到了这个问题,我发现如果您要为ios编写应用程序,则必须了解Objective C,否则所有其他选择都将使您失去所有优势,并使您的生活更加艰难。 ..
but You can use your objective C++ compiler to compile your C++ code :) 但是您可以使用目标C ++编译器来编译C ++代码:)

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

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