Build an Objective-C development environment in Ubuntu10.04

Source: Internet
Author: User
1. Introduction to Objective-C in the early 1980 s, Brad indeed invented Objective-C in Stepstone. Objective-C is a programming language based on the C language that adds object-oriented features and expands. Currently, it is mainly used in MacOSX and iPhoneOs Systems Based on OpenStep. Objective-C can be compiled and executed in any system running GCC, because GCC itself contains

1. Introduction to Objective-C
In the early 1980 s, Brad indeed invented Objective-C in Stepstone. Objective-C is a programming language based on the C language that adds object-oriented features and expands. Currently, it is mainly used in two OpenStep systems, Mac OS x and iPhone OS. Objective-C can be compiled and executed in any system running GCC, because GCC itself contains the Objective-C compiler. [1]

2. Install the Objective-C Development Environment
Many of my friends know that developing Objective-C requires an Apple Mac machine (not an amazing startup !). It is unrealistic to buy an apple book (if the reader's financial ability permits it, let alone it .), What should I do? In Ubuntu 10.04, you can use GNUStep for Objective-C development. Use the new installation package manager to install the software. After the installation is started, enter gnustep-devel, right-click and mark the installation, and the system will prompt you to install the relevant dependent software package (which is easy to manage). Then, select and click the application, to install.

3. Compile an instance
After the installation is complete, you must compile an instance [from Wikipedia] for verification. The example is as follows:

# Import

Int main (int argc, char * argv []) {
NSAID utoreleasepool * pool = [[NSAID utoreleasepool alloc] init];
NSLog (@ "Hello World! ");
[Pool drain];
Return 0;
}

Use the gedit or vi editor to edit the preceding content and save it as hello. m.

Open the terminal and enter the hello. m directory. Run the following command to edit the program:
$ Gcc hello. m 'gnustep-config -- objc-flags '-lgnustep-base-o hello

Two files are generated in the current directory: hello. d And hello (executable file ).
Run the executable program:
$./Hello
11:37:39. 917 hello [5170] Hello World!

4. Objective-C learning materials

The Objective C Programming Language
Http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html

Objective C on Ubuntu
Http://www.excession.org.uk/blog/objective-c-on-ubuntu.html

Beginners Guide to Objective-C Programming
Http://gnustep.made-it.com/BG-objc/

References
1. Wikipedia http://zh.wikipedia.org/zh-cn/Objective-C.
2. Build the Object-C development environment in Ubuntu
Http://www.linuxidc.com/Linux/2010-08/28064.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.