如何将一个简单的应用程序(仅使用标准 libc)移植到 iPhone 操作系统?
有一个用 C 编写的简单应用程序,其中仅包含标准 C 库函数(来自 stdio、stdlib 等)和 Makefile+GCC 来构建它。现在,我想将其移植到 iPhone/iPad 的 iPhone OS 上。它会是无缝的还是存在任何可能的不兼容问题?
There is a simple application written in C, which includes only standard C library functions (from stdio, stdlib, etc.) and Makefile+GCC to build it. Now, I wanna port it to iPhone OS for iPhone/iPads. Will it be seamless or are there any possible incompatibility issues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不能简单地为 iphone/ipad 操作系统编译代码,因为它们的应用程序是用 Objective C 编写的。不过好消息是,您可以在 Objective C 中使用 C/C++ 代码,具体操作方法如下:
Objective-C 编程语言简介
所以我建议如果你真的想移植你的应用程序,你可以开始学习一些 Objective C。请注意,所有 UI 都必须使用 Objective C 中的 UIKit 重新编写。
哦,而且,您还需要一台 Mac!
you cannot simply compile your code for the iphone/ipad OS, seeing their apps are written in objective C. Good news though, you can use your C/C++ code in objective C, here is how to do it:
Introduction to The Objective-C Programming Language
So I suggest you start learning some objective C if you really want to port your app. Be warned that all that is UI will have to be re-written with the UIKit, in objective C.
oooo and also, you will need a mac!
您的主要问题将是程序如何显示其输出 - 标准 C 库提供的支持与 iPhone 应用程序的预期不匹配。您将必须致力于计划的这些方面。
Your primary issue will be how the program displays its output - the support provided by the Standard C Library does not match what is expected of an iPhone application. You will have to work on those aspects of your program.