Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one use Obj-C 2.0 with GNUstep?

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.

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

like image 348
andyvn22 Avatar asked Nov 11 '10 01:11

andyvn22


People also ask

Can Objective c run on Windows?

The best platform for developing Objective‑C is Mac OS. But Objective‑C programs can also be compiled and run on Windows or Linux by using GNUstep and an Objective‑C compiler.

How do I install Objective C on Windows 10?

Installation on Windows In order to run Objective-C program on windows, we need to install MinGW and GNUStep Core. Both are available at https://www.gnu.org/software/gnustep/windows/installer.html. First, we need to install the MSYS/MinGW System package. Then, we need to install the GNUstep Core package.


1 Answers

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:

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.

The FAQ also calls out the following:

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.

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

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.

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.

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.

like image 85
MrGomez Avatar answered Sep 29 '22 04:09

MrGomez