How to compile objective-C Programs on Linux

Source: Internet
Author: User

Http://chchwy.blogspot.com/2010/05/linux-objective-c.html

How to compile objective-C Programs on Linux

1. Sort the following packages in sequence:

Sudo apt-get-y install build-essential
Sudo apt-get-y install gnustep
Sudo apt-Get install gobjc
Sudo apt-Get install gnustep-make
Sudo apt-Get install libgnustep-base-Dev

After security, we still need a command to renew the objc. Since this command needs to be called once every time it runs terminal, it is best to add it to. bashrc, and each login will automatically open the line.

./Usr/share/gnustep/makefiles/gnustep. Sh

Okay, now we have something to do. Now we will introduce the first objc program.

// Hello. m
# Import <Foundation/Foundation. h>

Int main (INT argc, const char * argv [])
{
NSAID utoreleasepool * Pool = [[NSAID utoreleasepool alloc] init];

Nslog (@ "Hello obj-C! ");
[Pool drain];
Return 0;
}

Zookeeper:

GCC 'gnustep-config -- objc-flags '-I/usr/include/gnustep-lgnustep-base hello. m

Congratulations! Your first objc program is complete.

Find/-name Foundation. h> 1.txt

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.