7

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?

3
  • 1
    You should take a look at GNUstep. Commented Apr 12, 2013 at 12:39
  • Take also a look at this project : Cocotron link Commented Apr 12, 2013 at 12:42
  • 1
    Both of those comments are the correct answers. I believe though, that cocotron's Linux support is limited. Commented Apr 12, 2013 at 12:44

1 Answer 1

12

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

Sign up to request clarification or add additional context in comments.

4 Comments

The official documentation is available at wiki.gnustep.org/index.php/User_Guides
Yes sure but the article is really good and helps "step-by-step" to install and work with gnustep
If your code use Objective-C 2.0 features like ARC, Objective-C literals, block, properties ... you cannot use GCC but you need to install clang and GNUstep Objective-c runtime. If you do not know how to limit yourself to old dialect, it's a very good idea to avoid the article and find another one for clang.
I'll mark this as the right answer. It didn't work for me because of my unusual circumstances of needing an external framework. But it did work for simpler examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.