如何将Obj-C 2.0与GNUstep一起使用? [英] How does one use Obj-C 2.0 with GNUstep?

查看:111
本文介绍了如何将Obj-C 2.0与GNUstep一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道libobjc2的存在,并且我知道我需要使用clang而不是GCC,但是我找不到关于编译过程有什么不同的任何基本说明.

I'm aware of the existence of libobjc2, and I gather that I'll need to use clang rather than GCC, but I can't find any basic instructions of what's different about the compilation process.

有人可以在获取,配置,编译和将GNUstep与 Ubuntu-Objective-C 2.0配合使用方面给出明确的分步说明吗?

Can anyone give explicit, step-by-step instructions on acquiring, configuring, compiling, and using GNUstep with Objective-C 2.0 in Ubuntu?

推荐答案

由于 GNUStep ObjC2常见问题解答已被引用,我假设您已经看过.但是,我想指出这一点:

Since the GNUStep ObjC2 FAQ has already been referenced, I'll assume you've had a look. I would like to point this out, however:

对于更高级的功能(当前仅在使用Clang进行编译时才受支持),您将需要GNUstep运行时.当前不认为这是生产就绪的.它应该可以替代GCC运行时,但是其中一些高级功能尚未经过充分测试.

For more advanced features, currently only supported if you compile with Clang, you will need the GNUstep runtime. This is not currently considered production ready. It should work as a drop-in replacement for the GCC runtime, but some of the advanced features are not well-tested.

常见问题解答还列出了以下内容:

如果您使用的是最新版本的GCC来编译代码,则应该拥有编译器随附的Objective-C运行时库的副本.

If you are using a recent version of GCC to compile your code then you should have a copy of the Objective-C runtime library that came with your compiler.

如果使用-fobjc-nonfragile-abi标志进行编译,则将使用新的ABI.仅GNUstep运行时支持此功能.这会添加:

If you compile with the -fobjc-nonfragile-abi flag then you will use the new ABI. This is only supported with the GNUstep runtime. This adds:

  • 财产自省
  • 对可选协议方法的自省
  • 非脆弱实例变量
  • 转发代理支持
  • Property introspection
  • Introspection on optional protocol methods
  • Non-fragile instance variables
  • Forwarding proxy support

因此,如果您要通过GCC寻找较旧的功能,则本教程将做得很好,就像这一个一样.您已经明确指出,您希望使用Clang提供的功能(通过 libobjc2 )做到这一点,该功能具有自己的文档床.

So, if you're looking for older functionality via GCC, this tutorial would do the job nicely, as would this one. You've explicitly called out that you're looking to do this with the functionality provided by Clang (via libobjc2), which has its own bed of documentation.

获得Clang的发行版并进行设置似乎很容易. LLVM入门文档异常强大(完整的文档档案

Obtaining a release of Clang and getting set up seems fairly cut and dried. The LLVM Getting Started document is exceptionally robust (full documentation archive here), which should provide insight into getting the backend set up and compiling properly. Some additional insight into the expected build procedure can be found here.

但是,在撰写本文时,用Clang编译Objective-C应用程序似乎文档不足,并且未经测试.随着功能的可用以及代码库的稳定,我可以想象会有更多的用户文档上线.

However, compiling an Objective-C application in Clang seems extremely underdocumented and untested at the time of this writing. As features become available and the codebase stabilizes, I imagine more user documentation will go live.

这篇关于如何将Obj-C 2.0与GNUstep一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆