Минимальный исходник:
// main.c #include <Cocoa/Cocoa.h> int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [NSApplication sharedApplication]; NSUInteger wndStyle = ( NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask); NSRect wndRect = NSMakeRect(100, 100, 400, 300); NSWindow *wnd = [[NSWindow alloc] initWithContentRect:wndRect styleMask:wndStyle backing:NSBackingStoreBuffered defer:NO]; NSWindowController *wndCtrl = [[NSWindowController alloc] initWithWindow:wnd]; [wndCtrl autorelease]; [wnd orderFrontRegardless]; [NSApp run]; [pool drain]; return 0; }
компилим примерно так:
$ gcc ./main.c -ObjC -o test -framework Cocoa