views:

60

answers:

3

I would like to start using Objective C for something projects, however I don't want to use any frameworks and libraries that are tied to Apple. What can I use to write portable code across Mac OS X, Linux, and maybe even Windows?

EDIT: I was thinking of very fundamental libraries like the FoundationKit and all that. I want to use Objective C as a language, and I can always use C and C++ libraries with it.

+1  A: 

Objective-C is supported by the gcc tool chain on all of its supported platforms. Of course, Objective-C is not particularly useful without libraries to go with it. GNUStep is the most well known of the options. GNUStep is an open source implementation of the NextStep/OpenStep libraries from which Apple's Cocoa frameworks evolved. As the Cocoa frameworks have evolved, GNUStep has often either not followed or diverged. Thus, it's not a "cross-platform Cocoa". It is probably better considered a fully different framework at this point. Nonetheless, GNUStep is a viable cross-platform option if you want to use Objective-C.

On the subject, however, why Objective-C? I'm a huge Objective-C fan, but much of what makes Objective-C awesome can be found in other modern, dynamic languages such as Python or Ruby. PyQt, a Python wrapper around the Qt toolkit, for example is an awesome cross-platform environment that has a similar free feeling to writing in Objective-C.

Barry Wark
And GNUStep comes with an implementation of the Foundation Kit.
Pierre
A: 

http://en.wikipedia.org/wiki/Objective-C#Today lists at least one option (though I can't vouch for how up-to-date it is).

Amber
A: 

Objective C is merely a language. With the right compiler, you can write codes on any platform you like. However, writing portable codes is another story because you'll have to deal with the underlying OS API calls as well as libraries. You can go check out the GCC compiler collection here.

shinkou
You'll also have to make sure that you have the proper runtime library; current GCC distributions include all what you need for - at least - a simple "hello, world" style Object-C program. But no Foundation Kit...
Pierre