Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I write and compile Objective-C code?

How do I write and compile Objective-C code in Linux?

I heard about Clang, but I couldn't find any example/tutorial about Clang/LLVM/Objective-C.

like image 289
Rusfearuth Avatar asked Jul 11 '12 16:07

Rusfearuth


3 Answers

sudo apt-get install build-essential gobjc gobjc++ gnustep gnustep-devel libgnustep-base-dev -y
vi *.m
gcc `gnustep-config --objc-flags` *.m -lgnustep-base -lobjc
like image 68
Aura Avatar answered Oct 10 '22 09:10

Aura


You download and build LLVM as the compiler infrastructure; then you download and build the CLANG front-end to compile C/C++ and Objective C/C++.

I guess you could try following this quick start guide. Mind that Clang could actually replace GCC when working with these languages.

like image 30
Jack Avatar answered Oct 10 '22 08:10

Jack


Take a look at http://www.gnustep.org/ they have tools for developing with Objective-C 2.0 for LINUX. The source files and hints on how to install it on several LINUX distros are here: http://www.gnustep.org/resources/sources.html

like image 3
Oscar Salguero Avatar answered Oct 10 '22 08:10

Oscar Salguero