在 Linux 中使用 cocoa 命令行应用程序
我正在用 Objective-C(在 xCode 中)编写一个使用 Foundation Framework 的命令行工具。我必须使用 Objective-C,因为我需要取消存档先前由 NSKeyedArchiver 存档的对象。
我的问题是,我想知道现在是否可以在我的 Linux Web 服务器上使用这个编译的应用程序。
我不确定是否会出现运行时问题,或者可执行文件是否可以是它自己的独立程序,实际上可以在我的 Linux 服务器上运行。
如果有任何反馈,我将不胜感激。
I'm writing a command line tool in Objective-C (within xCode) that uses the Foundation Framework. I have to use Objective-C because I need to unarchive objects previously archived by NSKeyedArchiver.
My question is, I'm wondering if I can now use this compiled application on my Linux web server.
I'm not sure if there would be a runtime issue or if the executable could be its own standalone program that could actually run on my Linux server.
I'd appreciate any feedback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 Cocotron 构建针对 Linux 的应用程序。它是一个实际的 Cocoa 实现,旨在完全互操作(尽管它当然不是 100% 完成),而不是 GNUstep,后者并不意味着以这种方式工作。我用这个,非常棒。
You can use The Cocotron to build your app targeted to Linux. It is an actual Cocoa implementation meant to fully interoperate (although it's not 100% complete of course), as opposed to GNUstep which is not meant to work that way. I use this and it is awesome.
不可以,您无法在 Linux 系统上运行在 Mac 上编译并为 Mac 编译的程序。因此,您必须为 Linux(以及在 Linux 上)编译它。 Apple 的 Foundation 框架不适用于 Linux,但请查看 GNUstep,一个免费且开放的 Cocoa 实现。
不过,我不知道 GNUstep 是否可以读取已使用 Cocoa 的
NSKeyedArchiver
存档的存档。No, you cannot run a program that was compiled on and for a Mac on a Linux system. So you will have to compile it for (and on) Linux. Apple's Foundation framework is not available for Linux, but have a look at GNUstep, a free and open Cocoa implementation.
I don't know if GNUstep can read archives that have been archived with Cocoa's
NSKeyedArchiver
, though.我提供了关于如何基于我博客上的Cocotron Foundation框架编译一个命令行工具。
这还包括关于 如何交叉编译 Ubuntu Linux 的 Foundation 框架。
希望这有帮助!
I have provided a wrap-up on how to compile a command line tool based on the Cocotron Foundation framework on my blog.
This does also include a step by step guide on how to cross compile the Foundation framework for Ubuntu Linux.
Hope this is helpful!