Objective-C in Linux [duplicate] - objective-c

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.

Related

compiling objective-c code for ios app on Windows

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.

Setting up Windows machine to write Objective-C code [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Objective C for Windows
iPhone development on Windows
How do i setup and write Objective-C on my Windows Vista (32 bit) machine?
Can someone please give me instructions?
You can use GNUStep http://www.gnustep.org/. You can also use Eclipse CDT with GNUStep, see configuration here http://wirecode.blogspot.com/2007/11/objective-c-and-eclipse.html
You might be able to compile Objective C code on a Windows machine using the GNUStep toolchain. But this will not allow you to write iPhone apps, as the Objective C runtimes are very different, so you won't be able to link with any of Apple's iOS frameworks, or use much of their example code.

Temporary iOS Development on Windows [duplicate]

This question already has answers here:
How can I develop for iPhone using a Windows development machine?
(42 answers)
Closed 5 years ago.
I am currently designing and planning an app that I intend to release for iPhone and iPad. I don't currently have a Mac, so I really have no way to actually publish the app, but I don't really want to buy a Mac either just for the development of the app.
Is there any way that I can write (and maybe even test) the app on Windows, then, once I have a finished product, buy a Mac or borrow a friends Mac to publish it.
I know that there is no way to publish to the Apple App Store without a Mac, but I was wondering if there is a way that I could develop and test the app (in Objective-C) on Windows.
I was wondering if there is a way that I could develop and test the app (in Objective-C) on Windows.
No, there is not. XCode is required for iOS development, and it is only available on Mac OS.
You could get a second, cheap hard drive, and install OS X on the hard drive to make your computer into a Hackintosh. You'd need a copy of OS X, and a willingness to break the TOS for the operating system.
This is actually a very frequently asked question, and I'm afraid the answer is no, you cannot do iOS development on Windows.
Back in the iPhone OS 2.0 days there was a cross-compiling framework that did accomplish this but it's abandoned and doesn't work for years now and AFAIK nobody bothered to make it work again (it's a lot of work and requires intimate knowledge about cross-compiling and hunts a constantly moving target).
The usual recommendation is to buy a used Mac Mini since they're cheaply available on sites like eBay.
duskwuff is right to a point... XCode itself is not actually requred in fact there is IDEA's AppCode IDE. Unfortunately, that only runs on OS X. The best thing you can do (other than get a cheap Mac) is install GCC on windows or a Linux VM compile from the command line, as GCC can compile Objective-C. However, that still is not a good solution since you won't have Access to Cocoa Touch and all those calls will error out as undefined or undeclared....
No, you can't. If your going to buy a Mac to publish in the future, why not just buy it now?
You can use OS X in a virtual machine on your windows system. I have read few articles on the internet how to do it using VirtualBox for that (google for it). Even if it's not officially supported by VirtualBox, it's possible. This breaks the TOC for OS X, and you need to buy a copy as well, but VirtualBox is free.
Yes you can!!!
Use virtual box.
Search some guides on "lifehacker.com" about getting mac on virtual box.
It's what I always used before getting a mac.

Multiplatform (Win, Mac, Linux) development environment to achieve native look-and-feel? (Just as Dropbox)

I've noticed that all betas for Dropbox are released simultaneously for Windows, Mac and Linux. How do they do that? Anyone knows which platform they're using? I'm aware that there are many native -very impressive, actually- functions in each of the platform clients, but they seem to release critical bug fixes efortlessly for all platforms.
So any idea of which GUI platform they're using?
The Linux version includes files such as wx._windows_.so, libwx_gtk2*.so, etc. (I haven't checked the others), so I suspect Dropbox uses wxWidgets.
Qt is a popular cross-platform application and GUI framework with native look-and-feel.
I don't know what Dropbox uses for all its supported platforms, but it looks like its linux client uses at least Gtk: Dropbox linux System Requirements.

Is it possible to deliver cross-platform binaries of FreePascal using only one host OS?

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.