Mac or Centos 下如何编译objective-C

#import <Foundation/Foundation.h>
int main(int argc,const char *argv[]){
@autoreleasepool{
NSLog(@"Hello world!");
}
return ;
}

jackluo@JackLuodeMacBook-Pro:~/Works/xcode/objective-c $gcc -framework Foundation -x objective-c -o hello  main.m

-x选项说明编译objective-c,-framework选项应该是制定Library的

jackluo@JackLuodeMacBook-Pro:~/Works/xcode/objective-c $./hello
2013-12-29 11:53:58.822 hello[703:507] Hello world!

上一篇:OAuth2.0实战(三)-使用JWT(上)


下一篇:ActiveMQ 的安装