Compilation and operation of Objective-c under Ubuntu

Source: Internet
Author: User

Ubuntu under compilation objective-c

1. Install the compilation environment

sudo Install build-essential gobjc gobjc++ gnustep gnustep-devel libgnustep-base-dev-y

2, write Makefile

pp:$ (s)         gcc ' gnustep-config--objc-flags ' $ (s)-O app-lgnustep-base-lobjcclean        :RM *. D         RM App

3. Write Test OC Code

1 #import <Foundation/Foundation.h>23int main (intconst Char* argv[])4{5         NSLog (@ "Hello world! " ); 6         return 0 ; 7 }

4. Compiling

 make s=main.mgcc ' gnustep-config--objc-flags ' Main.m-o APP-LGNUSTEP-BASE-LOBJC

5. Operation

$./app
2015-11-30 21:56:31.137 app[17597] Hello world!

6. Clear compilation and Target files

 Make Clean

Compilation and operation of Objective-c under Ubuntu

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.