The easiest way to compile is to write a GNUmakefile.
Let's say that you have a HelloWorld Project that has a main.m file.
//main.mGNUmakefile
#import <foundation/foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]
NSLog(@"Hello World");
[pool drain];
return 0;
}
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = HelloWorld
HelloWorld_OBJC_FILES = main.m
include $(GNUSTEP_MAKEFILES)/tool.make
Now type
makeinside the directory and you'll get a directory called obj were you have the executable.
Alternatively, you can use any of the following commands:
gcc `gnustep-config --objc-flags` -o main main.m -L /GNUStep/System/Library/Libraries -lobjc -lgnustep-baseOr
gcc -o main main.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString