0h84m9i0p3 发表于 2016-5-17 09:56:09

在Mac OS X下使用命令行编译Objective-C程序

  命令:clang -fobjc-arc -framework Foundation <prog file> -o <exe file> 

样例:

hello.h
——————
#import <Foundation/Foundation.h>

hello.m
——————
#import “hello.h”

int main()
{
     NSLog(@“hello");
     return 0;
}

$ clang -fobjc-arc -framework Foundation hello.m -o hello
$ ./hello   #执行
页: [1]
查看完整版本: 在Mac OS X下使用命令行编译Objective-C程序