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

查看:106
本文介绍了适用于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上进行开发,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天全站免登陆