我想用Objective-C(第4版)编程的书开始学习Objective-C。我在Windows XP上工作。要编译我在安装GNUstep的Objective-C程序,当我键入这个例子我在一些教程中找到:Windows和Objective-C
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"hello world");
[pool drain];
return 0;
}
它的一切工作正常。但是,当我尝试从本书中键入第一个例子:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
NSLog (@"Programming is fun!");
}
return 0;
}
我得到很多的错误:
难道谁知道我dooing错了吗?谢谢你的帮助。
可能[本教程](https://sweettutos.wordpress.com/2012/08/11/objective-c-on-windows-yes-you-can/)help !,它显示所需的环境,应该在Windows上设置。 – Malloc 2012-08-28 15:10:16