#include <Foundation/Foundation.h> int main(void) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog(@"Hello World!."); [pool drain]; return; }
gcc -o helloworld helloworld.m -I /GNUstep/GNUstep/System/Library/Headers
-L /GNUstep/GNUstep/System/Library/Libraries -std=c99 -lobjc -lgnustep-base -fconstant-string-class=NSConstantString
Make sure the folder structure of the path is your GNUstep installation path otherwise it will throw an error.
If you have another gcc (GNU compiler) installed on your computer (like for QT),
you may need to specify the location of the compiler exactly.
e.g. c:\GNUstep\bin\gcc -o helloworld...
6. Then type helloworld and Enter to run the generated helloworld.exe file.
If your environment variables have been set for a previous gcc installation, they
may have to be adjusted as well.
With this basic setup you can follow a book like Objective-C Programming
by Aaron Hillegass.
(Thanks to: teshguru at iesrilanka.org for this information.)
Next:
XCode and InterfaceBuilder on Windows