我知道這些問題之前已經被問到過,但是一切都表明使用GNUStep。沒有GNUStep使用Foundation的方法嗎?這對我來說也是一個學習問題(例如,如果可以通過鏈接文件或其他東西)Windows上的Foundation.h
我已經安裝了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;)我只是想用教學課程的內容。
感謝您的幫助!