Linux Clang and Objective-C base library

会有一股神秘感。 提交于 2020-01-14 01:45:29

问题


I have been experimenting with Objective-C using GCC + GNUstep on an Ubuntu system.

Now regarding the LLVM Clang compiler, what kind of *step library does it offer? Does it use the GNUstep on the Apple Cocoa? I am mostly interested in the base library - collections, streams, etc. The website doesn't give much information.


回答1:


LLVM Clang is a compiler. It is completely independent from the Cocoa / Cocoa Touch frameworks on OS X / iOS, or any other frameworks or platform, for that matter.




回答2:


Like MKroehnert and puzzle said, neither LLVM Clang nor GCC actually come with a set of frameworks. GCC comes with only a small runtime that doesn't provide NSArray, NSString, not even NSObject.

Frameworks are provided by, for example:

  • GNUstep
  • Cocotron
  • Cocoa
  • ObjFW

ObjFW is the lightest of them all, but on any UNIX, I'd recommend you go the GNUstep route.




回答3:


Like puzzle said in his answer clang is a compiler like gcc. On linux you can also use clang instead of gcc together with the GNUstep libraries (which provide the NS* classes you were asking about).

For more information see GNUstep Objc2 FAQ or this blogpost for example.




回答4:


Like others said, LLVM Clang is just a compiler. But you can have all the modern features of Objective-C 2.0 on Ubuntu using Clang, the modern GNUstep Objective-C 2.0 runtime and GNUstep itself. Have a look here for a how to:

http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux

That page is maintained by the GNUstep developers and contains bash scripts to compile and install everything needed for Objective-C 2.0 from scratch for different versions of Ubuntu-Linux using Clang and the GNUstep Objective-C runtime, which can be found here: https://github.com/gnustep/libobjc2 . It would be moot to copy those lengthy scripts to Stackoverflow since they would get out of date sooner or later. So follow that link to get everything from first hand.



来源:https://stackoverflow.com/questions/6392186/linux-clang-and-objective-c-base-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!