so take some code (at bottom) and compile it in gcc, like so:
gcc -framework Foundation -framework Cocoa untitled.m -ObjC -o test
now the output is test. run this from the terminal, and the process is still named "terminal". also running it by double clicking it does not allow it "to be itself" but it is still "terminal".
of course xcode creates apps that have their own name and don't depend on terminal to open. compiling the same code in xcode, it creates a product which looks like an app but is actually a wrapper around a few directories and a binary. even going down to this binary and double clicking it, it has its own name and icon in the dock.
what flags are needed to make gcc have this crucial output attribute? it's important because my program is capturing command-s etc, and instead of getting it, terminal gets it... thanks so much!
gcc -framework Foundation -framework Cocoa untitled.m -ObjC -o test
now the output is test. run this from the terminal, and the process is still named "terminal". also running it by double clicking it does not allow it "to be itself" but it is still "terminal".
of course xcode creates apps that have their own name and don't depend on terminal to open. compiling the same code in xcode, it creates a product which looks like an app but is actually a wrapper around a few directories and a binary. even going down to this binary and double clicking it, it has its own name and icon in the dock.
what flags are needed to make gcc have this crucial output attribute? it's important because my program is capturing command-s etc, and instead of getting it, terminal gets it... thanks so much!
Code:
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
int style = NSClosableWindowMask | NSResizableWindowMask |
NSTexturedBackgroundWindowMask | NSTitledWindowMask | NSMiniaturizableWindowMask;
NSWindow *win = [[NSWindow alloc] initWithContentRect:NSMakeRect(50, 50, 600, 400)
styleMask:style
backing:NSBackingStoreBuffered
defer:NO];
[win makeKeyAndOrderFront:win];
[NSApp run];
[pool release];
}