Tuesday, June 25, 2013

Compiling Objective-C Command Line in OS X Lion and OS X Mountain Lion

Method two worked on my MacBook Air running OS X Lion, and Method One worked on my MacBook Pro running OS X Mountain Lion.

Makefile


default: method_two

method_one:
 export PATH=$PATH:/System/Library/Frameworks
 clang -fobjc-arc main.m –framework Foundation -o program
 ./program

method_two:
 clang -fobjc-gc /System/Library/Frameworks/Foundation.framework/Foundation  main.m -o program 
 ./program

clean:
 rm -f program

main.m


// Remove the \ character -- Google Blogger is Having Problems
#import <\Foundation/Foundation.h\>

int main(int argc, char *argv[])
{
  @autoreleasepool {
 NSLog(@"Hello World!\n");
  }
  return 0;
}

4 comments :

steve said...

Its really great article..Thanks for sharing this useful information..
شركة شحن عفش من الرياض الى مصر
شركة شحن عفش من الدمام الى مصر
شركة ديكورات بالرياض
شركة دهانات في الرياض

Komali said...

Very Nice Article

Window Phones

brand new outlook

Ady said...

Nice Blog Post.Thanks for sharing this post.
Bigo Live is the most popular video broadcasting app on the mobile platform
Download the application
BIGO LIVE APK
BIGO LIVE LOGIN
MESSENGER APP
BIGO MOD APK
Bigo Live Stream Games
Bigo Live for Windows Phone
Excellent Platform

Rethu said...

Hey Nice Blog!!! Thank you for sharing information. Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!

Are you a social media narcissist? And you would like to be the same person on social media as you are in real life? ‘Yes’ then install

Click below link

Bigo Live Connector
50 Million Bigo Live connector
Bigo Live PC connecto
Bigo Live
Live Stream