在 Linux 中使用 cocoa 命令行应用程序

发布于 2024-11-01 17:50:32 字数 268 浏览 9 评论 0原文

我正在用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

幻梦 2024-11-08 17:50:32

您可以使用 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.

五里雾 2024-11-08 17:50:32

不可以,您无法在 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.

一瞬间的火花 2024-11-08 17:50:32

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文