我终于得到GNUstep的工作(在Windows),它编译和运行良好。但是,每当我尝试使用的NSLog,我得到以下错误:NSLog错误:找不到'NXConstantString'?
$ gcc -o hello hello.m -I /GNUstep/System/Library/Headers \
> -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base
hello.m: In function 'main':
hello.m:4:5: error: cannot find interface declaration for 'NXConstantString'
我的源代码:
#import <Foundation/Foundation.h>
int main(void) {
NSLog(@"hello world");
}
:
-lgnustep-base-fconstant-class=NSConstantString
正道试验,似乎我得到th每当我在我的字符串之前有一个@,而不仅仅是当我使用NSLog。 – 2011-02-12 04:37:50
这是我的整个代码。 – 2011-02-12 04:39:30
在你的字符串之前没有`@`会使它成为一个普通的C字符串,这是'NSLog`格式字符串使用的错误类型。 – 2011-02-12 06:18:31