ansi c应用程序的二进制文件可以在iPhone上运行吗?
我有一些用 ANSI C 编写的应用程序。我可以在 iPhone 上运行这些应用程序的二进制文件吗?如果不直接,还有其他有用的方法吗?我不想重写应用程序。
I have some applications that are written in ANSI C. Will I be able to run the binary files of those apps on the iPhone? If not directly, is there any other useful method to do so? I don't want to rewrite the applications.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
二进制文件?不太可能。当您编译到特定平台时,您往往会被锁定在该平台上。例如,您不能在 PPC Mac 上创建二进制文件并期望它们在 Intel CPU 上运行。
您的第一个问题是二进制文件是不同的语言(不同的处理器有不同的指令集,例如 Intel x86、PPC、SPARC 等)。第二个是其他平台可能没有相同的方式来实现磁盘 I/O 或用户交互等较低级别的功能。
如果它是 ANSI/ISO C,您应该能够为新平台重新编译它。或者,您可以使用模拟器来运行未更改的二进制文件。但不幸的是,直接在不适合的不同硬件上运行二进制文件是行不通的。
The binaries? Unlikely. When you compile to a specific platform, you tend to be locked into that platform. You can't, for example, take binaries created on a PPC Mac and expect them to run on an Intel CPU.
Your first problem is that the binaries are a different language (different processors have different instruction sets such as Intel x86, PPC, SPARC and so on). The second is that other platforms may not have the same way of implementing lower-level functions like disk I/O or user interaction.
If it's ANSI/ISO C, you should probably be able to re-compile it for the new platform. Or you may be able to use an emulator to run the binary unchanged. But running the binary directly on different hardware that it wasn't made for is not going to fly unfortunately.
估计是跑不了了。您应该将源代码编译到特定平台。
It probably won't be able to run. You should compile the source code to the specific plataform.