I'm looking to build Objective C software components that can run on Mac OS X and Linux. From my understanding, Cocoa software components can only be run on the Mac OS X platform. Does anyone have a good recommendation for a platform independent version of Objective C that can run on Mac OS X and Linux?
GNUStep may be an option. Sources mentioned in the answer to this SO question:
Compiling Objective-C app for Linux (API coverage)
Related
I'm not entirely sure about mac or anything, but what I want to do, is compile my objective-c program, for a mac, but compile it on a windows computer.
Is it possible to do this?
I have already successfully compiled an Objective-C program for windows on windows.
Compilation isn't the problem. Linking is.
You'll need something that can spit mach-o executables.
I'm not aware of an app that can specifically target OS X, but the existence of multiple tool chains that can produce iOS binaries on Windows. They typically require a Mac to do the signing for iOS, but that step is optional when targeting OS X.
I know objective-c code can be compilied on Windows by gnuStep. GnuStep clone most of the apple libraries but not all. So I am looking smart way find the remaining class since I assume using apple library on other os might be against the apple's licence.(Please don't aswer saying buy mac or wmvare solutions).
Thanks.
For iOS you depend on apple's frameworks (Cocoa Touch et al). They are only available on Mac OS X.
While it is possible, to run OS X on PCs (search for "Hackingtosh"), apple forbids to run it on non-apple hardware in its EULA.
I'm new to OS X world but i want to learn how to, and then build a Mac OS X application using Objective C and XCode.
What i don't know is for what platform should i compile this app so i can make it available to others.
Do i compile it for 32bit or most of the Macs are 64bit now and i'm ok by compiling it for 64bit?
Modern Macs are all 64-bit now, but you can still compile your apps for 32-bit/64-bit so they will work on both platforms.
If you are learning and have no need for backwards compatibility I would stick to 64-bit. That way you get to use all the advantages of the modern runtime (only available on 64-bit), and ARC(only available on 64-bit).
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Game programming on Objective-C and linux
I know that developing iPhone apps (painlessly, at least) pretty much requires a Mac. However, is it possible to develop normal desktop applications using Objective-C in Linux? For example, could I make a game using a development library for Objective-C, and release it for Linux, rather than iOS?
There are a lot of normal desktop applications which use GNUstep (free version of Cocoa API) on Linux.
For games you can try sdlobjc — SDL binding for Objective-C.
There is even a Linux distribution called Étoilé which uses GNUstep based user environment and all own GUI applications writen in Objective-C.
If you want to learn how to program in Objective-C using GNUstep on Linux (or cygwin) there are some possible problems:
You must use cygwin in windows to build the application. Which means that it:
a) some applications can be slowed down because of cygwin's translations of POSIX API calls to Win32 API calls. For example fork() call will be translated in Win32's CreateProcess call and some others and will be less efficient than in UNIX.
b) your application must be distributed with cygwin's dll
c) your application can't be 64bit (at least for now)
d) you application will see all your windows disk drives as a part of unix filesystem hierarchy (c: and d: will be /cygdrive/c and /cygdrive/d) and you will have /bin /tmp /usr /etc avialable under / as well.
There's not up-to-date books about GNUstep or about programming Objective-C not using Mac OS. Thre is Stephen Kochan's book "Programming in Objective-C 2.0 (2nd Edition)" where he unfortunately ommits explaination of how to build even basic examples under Linux or Windows. I hope it is fixed in 3rd edition.
GNUstep has own themes so apps may be themed differently than GTK Linux applications in Linux or usual themed application in Windows.
I'm doing a little app that I want to distribute in different platforms, at least the 3 major ones.
Is it possible to use only Windows has the host OS to compile the binaries for Linux, Mac OS X and other supported platforms without resorting to virtual machines?
Or should I ask around in some community to help me compile on, well OS X, actually, since I can virtualize a Linux machine quite easy?
It is possible to compile from one plateform to another, it is called cross-compilation. You will find extensive informations at http://www.stack.nl/~marcov/buildfaq.pdf
The buildfaq above contains sample cross-compilation :
from Windows to Linux,
from FreeBSD to AMD64 Linux
The FPC download page contains :
the i386-win32 to x86_64-win64 cross-compiler
the i386-win32 to arm-wince cross-compiler
The FPC mailing lists are at http://www.freepascal.org/maillist.var
You will find more informations about FPC at http://www.freepascal.org/moreinfo.var
(I'm the author of the buildfaq document above)
There are some limitations. You can't target x86 from powerpc, because powerpc misses an "extended" type. But in generally it works.
I have generated a complete Lazarus for OS X on Windows.
I would virtualize Linux, as even if you can cross-compile, it means you're not testing the binaries on their native platforms. OS X is a trickier problem.
It is not possible to compile from one platform to another. We have a Mac and use FPC quite often. If you need some help with compiling on a mac, drop me a message.