Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Objective-C Application on Linux

I've written a command line application in XCode using Objective-C. When added to my /usr/local/bin path is works as expected in OS X. However, I would like to make the binary work on Linux.

The binary relies on an Objective-C framework. How would I go about doing this? Or is it even possible?

Thanks

like image 513
Max Woolf Avatar asked Apr 12 '13 12:04

Max Woolf


People also ask

How is Objective-C compiled?

Objective-C uses the runtime code compilation The main reason is that it uses the runtime code compilation, rather than the compile time. This means that when the Objective-C object calls for another object in the code, there is an extra level of indirection involved.

How do I run an Objective-C program?

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.

Which C compiler is used in Linux?

GCC compiler is used to compile and run a C program on the Linux operating system. We can use the in-build text editor or other editors like Visual Studio Code or Sublime Text to write our C Programs.


1 Answers

Yes, it should be possible by installing GNUstep: http://www.gnustep.org/

The basics of Objective-C are supported by the GNU compiler collection. In order to utilize the full power of Objective-C together with the Cocoa /openStep environments on Linux, and to work with many of the examples covered in this book, it is necessary to install gcc, the gcc Objective-C support package and the GNUstep environment.

The gcc Objective-C support can be installed on Linux simply by installing the gcc-objc package which is available with all Linux distributions. There are, however, two different paths to installing GNUstep. On those Linux distributions for which pre-built GNUstep packages are provided this is simply a matter of issuing the appropriate command to install GNUstep. On Linux distributions for which pre-built packages are not available, the process involves downloading the GNUstep source code and then building and installing the packages manually.

Take a look at this article explaining this step by (gnu)step :) http://www.techotopia.com/index.php/Installing_and_Using_GNUstep_and_Objective-C_on_Linux

like image 54
Leo Chapiro Avatar answered Sep 21 '22 21:09

Leo Chapiro