我是Objective-C的新手。我试图用GNUstep编译Objective-C,但它给出了错误。我尝试在命令行上编译(gcc和makefile)。
No such file or directory /
excepted '>' before 'GSPredicateBlock'
…我使用命令行
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我尝试使用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-all_] Error 2
make[1]: *** [Hello.all.tool.variables] Error 2
make: *** [internal-all] Error 2我已经在谷歌上搜索过了,但是我找不到任何有用的东西。我在Windows7上安装了gnustep-msys-system-0.28.0-setup、gnustep-core-0.28.0-setup和gnustep-devel-1.3.0-setup。
发布于 2015-05-01 02:43:18
我不知道这是不是一个转移注意力的问题,但我看到有一个地方不应该有这样的空间:
Foundation/Found ation.h它应该是:
#import <Foundation/Foundation.h>(不带空格)在源代码文件中
显然,这就是编译器在这里抱怨的:
hello.m:1:71 fatal error: ../../GNUstep/System/Library/Headers/Foundation/Found ation.h: No such file or directory在源代码文件的import指令中删除该空格,然后重试。
https://stackoverflow.com/questions/6042628
复制相似问题