系统相关
首页 > 系统相关> > Ubuntu14.04 Objective-C hello world

Ubuntu14.04 Objective-C hello world

作者:互联网

原文链接:http://www.cnblogs.com/jmax/p/3764136.html

1. Install GNUstep

sudo apt-get install gnustep gnustep-devel

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

#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

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

4. Compile 

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

  

转载于:https://www.cnblogs.com/jmax/p/3764136.html

标签:www,int,gnustep,GNUstep,Objective,world,hello
来源: https://blog.csdn.net/weixin_30795127/article/details/99222609