为了开发iphone ,首先学习一下object c。
1.在window 下搭建环境,下载以下四个包,依次安装即可.
GNUstep MSYS System | Required | 0.25.1 | 0.27.0 | MSYS/MinGW System |
GNUstep Core | Required | 0.25.0 | 0.27.0 | GNUstep Core |
GNUstep Devel | Optional | 1.1.1 | 1.3.0 | Developer Tools |
Cairo Backend | Optional | 0.22.1 | None | Don't Use. Developer Only |
下载地址:http://www.gnustep.org/experience/Windows.html
2.在开始菜单打开 "GNUstep"->"shell"
3.用 vi 创建 hello.m文件,
// 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;
}
4.编译 hello.m
gcc -o hello hello.m /
-fconstant-string-class=NSConstantString /
-I /GNUstep/System/Library/Headers/ /
-L /GNUstep/System/Library/Libraries/ /
-lobjc /
-lgnustep-base
5.运行
./hello.exe