Cocoa needs to be linked explicitly. EXIT_SUCCESS is pretty pointless, and the same file uses exit(1) in other places.