Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1668359
  • 博文数量: 20
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 3272
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-04 09:45
文章分类

全部博文(20)

文章存档

2011年(3)

2010年(1)

2009年(1)

2008年(15)

我的朋友

分类: LINUX

2011-05-23 23:52:54

Objective-c is a nice object-oriented language. However, mac book is not cheap for most of us. I decides to learn the language on ubuntu first. To compile objective-c, you should install the following tools and use gcc to compile it as follows.
gcc gobjc gnustep-devel

#import<Foundation/Foundation.h>
int main(int argc, char *argv[]){

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSLog(@"Hello World!");

[pool drain];

return 0;

}

gcc hello.m `gnustep-config --objc-flags` -lgnustep-base -o hello
阅读(2007) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~