No need to create a make file. If you run MinGW from "All Programs → GNUstep → Shell" as described above, you can simply compile your .m file.
My GNUstep installation is located in the c: \ GNUstep \ GNUstep \ System directory. If you have something else, you should modify the Foundation.h import accordingly.
I have done this:
- Create c: \ myprogs \ obj-c \ hello \ hello.m, which looks like this:
// ---------- Hello.m
#import <../../GNUstep/System/Library/Headers/Foundation/Foundation.h>
int main(int argc, const char* argv[])
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Hello from Hello.m!");
[pool release];
return 0;
}
//----------
MinGW. (. .)
, . ( , , Unix, Windows.):
cd/c/myprogs/obj-c/hello
:
gcc -o hello hello.m -I/c/GNUstep/GNUstep/System/Library/Headers\
-L/c/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base\
-fconstant-- = NSConstantString
( , "\" .)
:
Info: resolving ___objc_class_name_NSAutoreleasePool by linking to __imp____objc_class_name_NSAutoreleasePool (auto-import)
Info: resolving ___objc_class_name_NSConstantString by linking to __imp____objc_class_name_NSConstantString (auto-import)
hello.exe :
2009-06-03 14:44:59.483 hello[1240] Hello from Hello.m!