Whats wrong with this program?
// main.m
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
    return NSApplicationMain(argc, (const char **)argv);
}
I try to compile and get this error:
$ clang -framework Foundation main.m
Undefined symbols for architecture x86_64:
  "_NSApplicationMain", referenced from:
      _main in main-c04948.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$
You've linked against Foundation, but not AppKit or Cocoa. NSApplicationMain() is part of AppKit. You need to replace -framework Foundation with -framework AppKit or -framework Cocoa (they are more or less synonymous).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With