Windows上的Foundation.h.

时间:2011-11-26 18:21:18

标签: windows cocoa foundation cocotron

我知道之前已经提出过这些问题,但所有建议都使用GNUStep。有没有办法在没有GNUStep的情况下使用Foundation?这对我来说也是一个学习问题(如果可以通过链接文件或其他东西来完成)

我安装了Cygwin和gcc。我从CocoaTron获得了所有的库,如下所示:http://code.google.com/p/cocotron/source/browse/

我将库文件夹添加到OBJC_INCLUDE_PATH和C_INCLUDE_PATH中,它不再抱怨无法再找到Foundation.h。

但是我得到了其他错误:

$ gcc intro.m -o intro
In file included from /cocoa/CoreFoundation/CFBase.h:144,
                 from /cocoa/CoreFoundation/CFAttributedString.h:8,
                 from /cocoa/CoreFoundation/CoreFoundation.h:42,
                 from /cocoa/Foundation/Foundation.h:37,
                 from car.h:1,
                 from intro.m:2:
/cocoa/CoreFoundation/CFString.h:88: error: parse error before "va_list"
In file included from /cocoa/Foundation/NSAffineTransform.h:9,
                 from /cocoa/Foundation/Foundation.h:41,
                 from car.h:1,
                 from intro.m:2:
/cocoa/Foundation/NSGeometry.h:9:32: Foundation/NSObject.h: No such file or directory
In file included from /cygdrive/d/Allebrum Resources/C Libraries/cocoa/Foundation/NSAffineTransform.h:9,
                 from /cygdrive/d/Allebrum Resources/C Libraries/cocoa/Foundation/Foundation.h:41,
                 from car.h:1,
                 from intro.m:2:

我很抱歉新手问题,我只是对运行一些测试感兴趣并且不想安装GNUStep。

我的意思是,一个非常简单的例子:

//car.h
#import <Foundation/Foundation.h>
@interface Car : NSObject{
}
- (void)addGas;
@end

#include <stdio.h>
#import "car.h"

int main(int argc, const char * argv[]){
printf("Hello");
return 0;
}  

是的,我知道这个例子不需要objC;)我只是想跟随一个教程。

感谢您的帮助!

1 个答案:

答案 0 :(得分:2)

查看the Cocotron's requirements pagegeneral information page,似乎它只支持Mac上的开发。它提供的是能够在Mac上构建与Windows或Linux兼容的产品....

所以,据我所知,目前你不能使用Cocotron在Windows上开发。你仍然需要使用GNUstep。

相关问题