日期:2014-05-17  浏览次数:20662 次

Windows平台进行Objective-C开发

(1)安装GNUstep

首先去http://www.gnustep.org/experience/Windows.html官网下载GNUstep MSYS SystemGNUstepCoreGNUstep Devel这三个工具。


由于按网上教程下的是gnustep-system-0.24.2-setup.exe,导致正确编译后,运行的时候报缺一堆dll

下载好后先安装gnustep-msys-system-0.30.0-setup.exe,接着安装另外两个,一路点击下去就可以了。

(2) 测试安装正确与否

(2.1)E:\Oct\OC用文本编辑一个文件hello.m,代码如下:

#import <Foundation/Foundation.h> 


int main(int argc,const char *argv[]){


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

  NSLog(@"hi,zxy!");

  [pool drain];

 

  return 0;

}

(2.2)开始->程序->GNUstep->Shell


Shell中输入命令: