TIDE
Languages

Objective-C

Installing Objective-C on Ubuntu in TIDE

Objective-C

Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to C. On Linux environments, Objective-C applications are compiled with GCC or Clang using GNUstep libraries.

Installation

Install the GCC Objective-C compiler (gobjc) and GNUstep foundation development libraries:

apt update
apt install -y gobjc gnustep-devel

Verification

Check that GNUstep tools are installed:

gnustep-config --version

Writing and Compiling Code

Create an Objective-C source file named hello.m:

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSLog(@"Hello, World!");
    }
    return 0;
}

Compile the program using GCC with GNUstep flags:

gcc `gnustep-config --objc-flags` hello.m -o hello `gnustep-config --base-libs`

Run the compiled executable:

./hello

Official Resources

On this page