Objective-c Study Notes-Ubuntu environment setup + HelloWorld

Source: Internet
Author: User

I have always wanted to learn about IOS Mobile Phone development. Today I am involved in this field. Well, start with the basics -- Build the development environment.

System: Ubuntu 12.04 LTS 64-bit

Environment setup steps:

1. Install the Compiler

 sudo apt-get install gnustep*

2. Configure Environment Variables

# set GNUstepGNUSTEP_ROOT=/usr/share/GNUstep/Makefilesexport GNUSTEP_ROOTsource /usr/share/GNUstep/Makefiles/GNUstep.sh

3. Compile HelloWorld test and installation environment hello. m

#import 
 
  int main(int argc , const char * argv[]){        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];        NSLog(@"Hello World! \n");        [pool drain];        return 0;}
 

4. Compile the GNUMakefile file (in the same directory as the hello. m file)

include $(GNUSTEP_ROOT)/common.makeTOOL_NAME = HelloWorldHelloWorld_OBJC_FILES = hello.minclude $(GNUSTEP_ROOT)/tool.make

Remember that the settings in GNUSTEP_ROOT and environment variables are consistent.


Make

There is an executable file HelloWorld In the obj directory and the file output is:

./obj/HelloWorld2014-05-04 07:07:35.340 HelloWorld[15727] Hello World!



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.