in order to compile Objective-C on Windows we need to install following package which is called GNUstep if you are a Windows user go to this link and download and install at least the first three packages.
then go to start –> all programs –> GNUstep –> shell
it is a Unix like terminal where you can issue some unix terminal commands. Then open your favorite text editor in my case I am using Vim by just typing vim and enter on the shell I opened up earlier but you can use Notepad++ or any other appropriate text editor.
#import <stdio.h> int main( int argc, const char *argv[] ) { printf( "hello world\n" ); return 0; }
and save it as hello.m remember to save it in the home folder as GNUstep installed if you’d have used vim there won’t be any problem but if you used any other text editor don’t forget to save it in there in my case the path is : C:\GNUstep\home\Keshan so yours might look similar to this. Then in the terminal type :
gcc `gnustep-config –objc-flags` –L /GNUstep/System/Library/Libraries hello.m –lgnustep-base –lobjc
and then to run simply type ./a
so this is a basic hello world program but Objective-C is bit different this is simply a C like program actually Objective-C is an extended version of C you can find loads of tutorial about Objective-C and try them out on Windows with this cool package. here is the same code run on Mac OS X