Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A really embarassing, newbie question.

  1. Aug 25, 2008 #1
    So I'm trying to cod C on my Mac, and I've downloaded GCC from the GNU website, and unzipped all the files.

    My problem is, I don't know how to access the compiler so I can actually write the code.

    Please pardon my stupidity, and hopefully help me get started.
     
  2. jcsd
  3. Aug 25, 2008 #2

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    You should look for and read the documentation. In the files you unzipped, you'll probably find some files named INSTALL or SETUP, etc.

    - Warren
     
  4. Aug 25, 2008 #3
    You actually do not need a compiler to write c code, the code is written with the help of a text editor. You only need the compiler to compile files.
     
  5. Aug 25, 2008 #4
    I recommend you get Dev C++ (bloodshed)
     
  6. Aug 25, 2008 #5

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    gcc is a command line compiler it's not an integrated development enviroment like you might be used to. You have to write the code in an editor and then compile on the command line with the gcc command.

    You might be better downloading the gcc build from apple, see http://developer.apple.com/tools/gcc_overview.html

    Don't apple have a free C++ IDE called Xcode? Since Apple is now unix based most of the free development enviroments for Linux will also work, eg. Eclipse and KDevelop.
     
  7. Aug 26, 2008 #6
    Okay...

    1. You don't want to install GCC from the GCC website.

    2. You DEFINITELY do not want to install Dev-C++, it is for windows.

    3. Go to http://developer.apple.com/mac/ . Log in and download the developer CD (this may be labelled "XCode"). Run the installer. It will install GCC and a bunch of other tools.

    4. Once you have done that you can compile either by (1) use XCode, which is apple's IDE or (2) open a new terminal window and type "gcc filename.c -o programname", this will compile filename.c and put the results into an executable called programname.
     
  8. Aug 26, 2008 #7
    Thanks for the help, I was able to get it working through XCode; I spent a lot of time making it more difficult than it had to be.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: A really embarassing, newbie question.
Loading...