码迷,mamicode.com
首页 > 其他好文 > 详细

Ubuntu14.04 Objective-C hello world

时间:2014-06-02 12:49:08      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:c   class   blog   code   a   int   

1. Install GNUstep

1
sudo apt-get install gnustep gnustep-devel

2. Write hello world program, and save as hello.m

1
2
3
4
5
6
7
8
9
10
#import <Foundation/Foundation.h>
 
int main (int argc, const char * argv[])
{
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
 
        NSLog (@"hello world");
        [pool drain];
        return 0;
}

3. Set GNUstep compile enviroment

1
. /usr/share/GNUstep/Makefiles/GNUstep.sh

4. Compile 

1
gcc hello.m `gnustep-config --objc-flags` `gnustep-config --objc-libs` -lobjc -lgnustep-base -o hello

  

Ubuntu14.04 Objective-C hello world,布布扣,bubuko.com

Ubuntu14.04 Objective-C hello world

标签:c   class   blog   code   a   int   

原文地址:http://www.cnblogs.com/jmax/p/3764136.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!