Objective-c in Ubuntu Linux

来源:互联网 发布:小说录入软件 编辑:程序博客网 时间:2024/06/03 16:58

Objective-c in Linux, very common question Many times i stumbled with this question how can i compile my objective-c code in ubuntu or in linux and the Answer is “GNUSTEP” . It’s inherited from Apple NextStep :) . so how can you use

Installation procedure :
Login with your root account and type these commands one by one

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

How To Run Objective-c:

Every objective-c file must have a “.m” extension e.g main.m . Open your editor and sve your hello world (hello.m)

#import

int main( int argc, const char *argv[] ) {
printf( “hello world\n” );
return 0;
}

Compile the application

shell> gcc -o hello hello.m

Run the application

shell>./hello

Thats it . Thanks for enjoying this article , If you have any doubt or suggestion please comment the post



Read more: http://vipinsahu.com/objective-c-in-ubuntu-linux#ixzz2C5MMEHYL

转载地址:http://vipinsahu.com/objective-c-in-ubuntu-linux

原创粉丝点击