Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

C compiler in Snow Leopard Terminal!?!?!?

  • 07-10-2009 04:29PM
    #1
    Registered Users, Registered Users 2 Posts: 1,304 ✭✭✭


    Hey! I recently up graded to snow leopard. Since then I have been unable to compile c files using the cc command in the terminal. I use xcode to write my C files but I cant figure out how to compile the files in xcode.
    Can anyone shed some light on where the compiler is gone and how to compile a basic c program using xcode! Any help would be appreciated!


Comments

  • Registered Users, Registered Users 2 Posts: 2,534 ✭✭✭FruitLover


    Do you get some sort of error message? Maybe try gcc instead.


  • Closed Accounts Posts: 6,151 ✭✭✭Thomas_S_Hunterson


    There should be a compile button in the project window (I think) in Xcode.


  • Registered Users, Registered Users 2 Posts: 6,790 ✭✭✭cornbb


    First try gcc instead of cc. If that doesn't work Install Xcode/developer tools from your install DVDs and make sure you install the optional Unix development tools.

    To build in Xcode just hit cmd-B. Make sure your project is initially set up using cmd-shift-N and then set up with an appropriate template (console or terminal or something. Can't remember off the top of my head)


  • Hosted Moderators Posts: 7,486 ✭✭✭Red Alert


    gcc -v
    should tell you the version.

    XCode should just automatically compile any C files you put in there into a project.


  • Registered Users, Registered Users 2 Posts: 1,304 ✭✭✭oneofakind32


    My compiler looks a bit like this.
    neal-heneghans-computer:desktop nealheneghan$ ls
    Big Me.rtf crucial order no..rtf
    C junk guess.c
    neal-heneghans-computer:desktop nealheneghan$ cc guess.c
    -bash: cc: command not found
    neal-heneghans-computer:desktop nealheneghan$ gcc guess.c
    -bash: gcc: command not found
    neal-heneghans-computer:desktop nealheneghan$ gcc -v
    -bash: gcc: command not found
    neal-heneghans-computer:desktop nealheneghan$ gcc-v
    -bash: gcc-v: command not found
    neal-heneghans-computer:desktop nealheneghan$
    Will try reinstalling xcode from the snow leopard disk and get back to ye


  • Advertisement
  • Closed Accounts Posts: 6,151 ✭✭✭Thomas_S_Hunterson


    You sure you've put Xcode on it?


  • Closed Accounts Posts: 3,150 ✭✭✭ozt9vdujny3srf


    As far as I am aware, for snow leopard you need to install the version that comes with it or later for it to work.


Advertisement