How do I write and compile Objective-C code?

前端 未结 4 1940
忘了有多久
忘了有多久 2021-02-13 03:58

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.

相关标签:
4条回答
  • 2021-02-13 04:09

    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

    0 讨论(0)
  • 2021-02-13 04:10

    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.

    0 讨论(0)
  • 2021-02-13 04:22

    Just run the following script shown on this page:

    https://gist.github.com/nicerobot/5652802

    Pay attention: During the first compiling process you will get an error. Solution is just to recompile it... It works !!! Here is the blog entry from the step by step installation but I really recommend the script!

    http://blog.tlensing.org/2013/02/24/objective-c-on-linux-setting-up-gnustep-clang-llvm-objective-c-2-0-blocks-runtime-gcd-on-ubuntu-12-04/#comment-54284

    regards

    0 讨论(0)
  • 2021-02-13 04:28
    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
    
    0 讨论(0)
提交回复
热议问题