如何编写和编译Objective-C代码?

时间:2022-08-01 22:26:45

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

如何在Linux中编写和编译Objective-C代码?

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

我听说了Clang,但我找不到任何关于Clang/LLVM/Objective-C的例子/教程。

4 个解决方案

#1


10  

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

#2


9  

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++.

您下载并构建LLVM作为编译器基础结构;然后下载并构建CLANG前端,编译C/ c++和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.

我想你可以试试下面这个快速入门指南。注意,在使用这些语言时,Clang实际上可以替代GCC。

#3


3  

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

看看http://www.gnustep.org/他们有针对LINUX使用Objective-C 2.0开发的工具。关于如何在几个LINUX发行版上安装它的源文件和提示如下:http://www.gnustep.org/resources/sources.html

#4


0  

Just run the following script shown on this page:

运行本页所示的脚本:

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

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

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/评论- 54284

regards

问候

#1


10  

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

#2


9  

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++.

您下载并构建LLVM作为编译器基础结构;然后下载并构建CLANG前端,编译C/ c++和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.

我想你可以试试下面这个快速入门指南。注意,在使用这些语言时,Clang实际上可以替代GCC。

#3


3  

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

看看http://www.gnustep.org/他们有针对LINUX使用Objective-C 2.0开发的工具。关于如何在几个LINUX发行版上安装它的源文件和提示如下:http://www.gnustep.org/resources/sources.html

#4


0  

Just run the following script shown on this page:

运行本页所示的脚本:

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

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

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/评论- 54284

regards

问候