适用于 Windows 的 Objective-C [英] Objective-C for Windows

查看:21
本文介绍了适用于 Windows 的 Objective-C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Windows 平台上编写 Objective-C 的最佳方式是什么?

What would be the best way to write Objective-C on the Windows platform?

Cygwin 和 gcc?有没有办法将它集成到 Visual Studio 中?

Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio?

沿着这些思路 - 是否有任何关于如何链接和使用 Windows SDK 的建议.它是一个不同的野兽,但我知道我可以在 Windows DLL 中编写程序集和链接,让我可以访问这些调用,但我不知道如何在不使用谷歌搜索和获得零碎指示的情况下做到这一点.

Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I know I can write assembly and link in the Windows DLLs giving me accessibility to those calls but I don't know how to do this without googling and getting piecemeal directions.

有没有人知道一个很好的在线或书籍资源来做或解释这些事情?

Is anyone aware of a good online or book resource to do or explain these kinds of things?

推荐答案

扩展前两个答案,如果您只需要 Objective-C 而不是任何 Cocoa 框架,那么 gcc 将适用于任何平台.您可以通过 Cygwin 或获取 MinGW 使用它.但是,如果您想要 Cocoa 框架,或者至少是它们的合理子集,那么 GNUStep 和 Cocotron 是您最好的选择.

Expanding on the two previous answers, if you just want Objective-C but not any of the Cocoa frameworks, then gcc will work on any platform. You can use it through Cygwin or get MinGW. However, if you want the Cocoa frameworks, or at least a reasonable subset of them, then GNUStep and Cocotron are your best bets.

Cocotron 实现了很多 GNUStep 没有的东西,例如 CoreGraphics 和 CoreData,但我不能保证它们在特定框架上的实现有多完整.他们的目标是让 Cocotron 与最新版本的 OS X 保持同步,以便任何可行的 OS X 程序都可以在 Windows 上运行.由于 GNUStep 通常使用最新版本的 gcc,因此它们还添加了对 Objective-C++ 和许多 Objective-C 2.0 功能的支持.

Cocotron implements a lot of stuff that GNUStep does not, such as CoreGraphics and CoreData, though I can't vouch for how complete their implementation is on a specific framework. Their aim is to keep Cocotron up to date with the latest version of OS X so that any viable OS X program can run on Windows. Because GNUStep typically uses the latest version of gcc, they also add in support for Objective-C++ and a lot of the Objective-C 2.0 features.

我没有用 GNUStep 测试过这些功能,但是如果您使用足够新的 gcc 版本,您或许可以使用它们.几年前,我无法在 GNUStep 中使用 Objective-C++.但是,GNUStep 几乎可以从任何平台进行编译.Cocotron 是一个非常以 Mac 为中心的项目.虽然可能可以在其他平台上编译它,但它带有 XCode 项目文件,而不是 makefile,所以你只能在 OS X 上开箱即用地编译它的框架.它还带有在 XCode 上编译 Windows 应用程序的说明,但没有任何其他平台.基本上,为 Cocotron 设置一个 Windows 开发环境可能是可能的,但它不像为 GNUStep 设置一个那么容易,而且您将独自一人,因此如果您正在开发,GNUStep 绝对是您的最佳选择Windows 而不是 Windows.

I haven't tested those features with GNUStep, but if you use a sufficiently new version of gcc, you might be able to use them. I was not able to use Objective-C++ with GNUStep a few years ago. However, GNUStep does compile from just about any platform. Cocotron is a very mac-centric project. Although it is probably possible to compile it on other platforms, it comes XCode project files, not makefiles, so you can only compile its frameworks out of the box on OS X. It also comes with instructions on compiling Windows apps on XCode, but not any other platform. Basically, it's probably possible to set up a Windows development environment for Cocotron, but it's not as easy as setting one up for GNUStep, and you'll be on your own, so GNUStep is definitely the way to go if you're developing on Windows as opposed to just for Windows.

就其价值而言,Cocotron 在 MIT 许可下获得许可,而 GNUStep 在 LGPL 下获得许可.

For what it's worth, Cocotron is licensed under the MIT license, and GNUStep is licensed under the LGPL.

这篇关于适用于 Windows 的 Objective-C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆