gcc doesn't work

Discussion in 'Mac Programming' started by Mister V, Jan 4, 2013.

  1. macrumors newbie

    Hi guys,

    the problem which I am struggling with is that I wanna compile an objectiveC code via terminal and it doesn't work.

    I have the Xcode 3 version but OS X Mountain Lion.

    After entering the command

    gcc -framework Foundation -fobjc-gc-only -o Program sourcecode.m

    terminal says: bash:command gcc not found
  2. macrumors G5


    Xcode 4.5 is a free download from the App Store.

    Any particular reason why you are trying to use gcc and not clang?
  3. LPZ
    macrumors 65816

    What about

    /usr/bin/gcc -framework Foundation -fobjc-gc-only -o Program sourcecode.m 
  4. macrumors newbie

    I've already tried clang... :/
    reason: OS X Mountain Lion and old version of xcode?
  5. macrumors 603


    Download Xcode 4 from the App Store (it's free), then open preferences -> downloads and download & install the command line tools.

    IDK of any other ways to install the command line tools (not that I've tried.)
  6. macrumors 68000

    They now have a download that's only 171MB instead of almost 2GB for all of XCode. It just includes the command-line tools.

  7. Moderator


    Staff Member

    Silly me, I though that package required Xcode to be installed first. At least that's how I've used it.


Share This Page