I don't know how to do with my gcc....

Discussion in 'Mac Programming' started by hensonzyw, May 26, 2010.

  1. hensonzyw macrumors newbie

    Joined:
    May 26, 2010
    Location:
    wuhan,Hubei,China
    #1
    HELP! I'm a new Mac user, and I have to study C/C++. I have installed xcode in my mac, but after I researched in google, they told me I don't necessarily have to use the xcode that high-level software, the GCC is quite suitable for me. But I don't even know how to start the gcc program... Don't laugh at me, I'm really eager to study...Thank you :apple:
     
  2. qtx43 macrumors 6502a

    Joined:
    Aug 4, 2007
    #3
    Also, once you open the terminal, you can treat it like pretty much any generic unix box from the command line. Except for installing programs, you'll probably want to go the OSX way, but any documentation on programming APIs, including low level things like read/write, are the same (pretty much) for all unix. So linux and bsd and just general C programming docs are useful too.
     
  3. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #4
    1. Make sure you have the latest XCode version. Look for it at developer.apple.com . Helps when everyone is talking about the same thing.

    2. Start XCode and create a new project with type Application / Command Line Tool / C Command Line Tool. Build and compile it and run it and check on the console what the output is. Hint: If you don't know how to do any of these things in XCode, look through the menus.
     
  4. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
  5. hensonzyw thread starter macrumors newbie

    Joined:
    May 26, 2010
    Location:
    wuhan,Hubei,China
    #6
    thx a lot, I'll try what you have told me today. You mean GCC is not a seperate program but a part of xcode?
     
  6. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #7
    It is separate, but a gcc installer is included in the Developer Tools download.
     
  7. hensonzyw thread starter macrumors newbie

    Joined:
    May 26, 2010
    Location:
    wuhan,Hubei,China
    #8
    that's the problem. I can't find the gcc installer in my developer tools file....
    using the spotlight I can search out many files named gcc, but I can't find any applications....
     
  8. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #9
    Install Xcode.

    Open Terminal.

    Type "gcc". If it comes up with something like this:

    Code:
    i686-apple-darwin10-gcc-4.2.1: no input files
    you're good to go.
     

Share This Page