I'm a newbie in Objective-C. I'm trying to compile Objective-C with GNUstep but it's giving errors. I tried to both compile on command line (gcc and makefile).
No such file or directory /
excepted '>' before 'GSPredicateBlock'
…
I used the command line
gcc gnustep-config --objc-flags -o hello hello.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString -enable-auto-import
My attempt at using a makefile:
Making all for tool Hello...
Compiling file hello.m ...
hello.m:1:71 fatal error: ../../GNUstep/System/Library/Headers/Foundation/Found ation.h: No such file or directory
compilation terminated.
make[3]: *** [obj/Hello.obj/hello.m.o] Error 1
make[2]: *** [internal-tool-开发者_如何学Goall_] Error 2
make[1]: *** [Hello.all.tool.variables] Error 2
make: *** [internal-all] Error 2
I've searched Google, but I can't find anything that helps. I installed gnustep-msys-system-0.28.0-setup
, gnustep-core-0.28.0-setup
and gnustep-devel-1.3.0-setup
on Windows 7.
I don't know if this is a red herring but I see there's a space in a place where it should not be:
Foundation/Found ation.h
it should read:
#import <Foundation/Foundation.h>
(without the space) in your source code file
Obviously this is what the compiler complains about here:
hello.m:1:71 fatal error: ../../GNUstep/System/Library/Headers/Foundation/Found ation.h: No such file or directory
remove that space in your source code file's import directive and try again.
精彩评论