【发布时间】:2011-05-18 09:36:52
【问题描述】:
我是 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
我在 Google 上进行了搜索,但找不到任何有用的信息。我在 Windows 7 上安装了 gnustep-msys-system-0.28.0-setup、gnustep-core-0.28.0-setup 和 gnustep-devel-1.3.0-setup。
【问题讨论】:
-
错误是:在“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 -在命令行中导入 -
我建议为 GNUstepMake 编写一个 Makefile。这消除了可能是错误的编译器命令。有关示例,请参见此处:gnustep.it/nicola/Tutorials/WritingMakefiles/index.html
-
我正在尝试这样做(GNUstepMake 的 Makefile),但它有同样的错误。我该怎么办?请告诉我。
-
当我编译 hello.m 时出现错误并得到 hello.d 没有 .exe。这个呢。
-
为工具 Hello... 编译文件 hello.m ... hello.m:1:71 致命错误:../../GNUstep/System/Library/Headers/Foundation/ Foundation.h:没有这样的文件或目录编译终止。 make[3]: *** [obj/Hello.obj/hello.m.o] 错误 1 make[2]: *** [internal-tool-all_] 错误 2 make[1]: *** [Hello.all .tool.variables] 错误 2 make: *** [internal-all] 错误 2
标签: objective-c gnustep