使用 GNUstep 编译 Objective-C

发布于 2024-11-07 15:12:37 字数 1027 浏览 0 评论 0原文

我是 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,但找不到任何有帮助的东西。我安装了 gnustep-msys-system-0.28.0-setupgnustep-core-0.28.0-setupgnustep-devel-1.3.0-setup在 Windows 7 上。

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-all_] 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

桃酥萝莉 2024-11-14 15:12:37

我不知道这是否是一个红鲱鱼,但我看到在不应该出现的地方有一个空格:

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

删除源代码文件的导入指令中的空格,然后重试。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文