A really embarassing, newbie question.

  • Thread starter Thread starter chasely
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the challenges faced by a user attempting to set up a C programming environment on a Mac using GCC. Participants provide various suggestions and insights regarding the installation and usage of compilers and integrated development environments (IDEs).

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant expresses confusion about accessing the GCC compiler after downloading it from the GNU website.
  • Another participant suggests reading the documentation included in the downloaded files, specifically looking for INSTALL or SETUP files.
  • A different participant clarifies that a compiler is not needed to write C code, as code can be written in a text editor, with the compiler only required for compiling the code.
  • One suggestion is made to use Dev C++, although it is later pointed out that this is not suitable for Mac users.
  • Another participant explains that GCC is a command line compiler and emphasizes the need to write code in an editor before compiling it via the command line.
  • There is a recommendation to download GCC from Apple's developer site and to consider using Xcode, which is Apple's IDE.
  • A later reply reiterates the steps to install Xcode and compile code, confirming that the original poster successfully set up their environment using Xcode.

Areas of Agreement / Disagreement

Participants generally agree on the recommendation to use Xcode for Mac users and the inappropriateness of using Dev C++. However, there is no consensus on the best approach to access and use the GCC compiler, as different methods are suggested.

Contextual Notes

Some participants assume familiarity with command line operations and IDEs, which may not be the case for all users. There is also a lack of clarity regarding the specific steps needed to configure the environment properly, as different suggestions are presented.

chasely
Messages
2
Reaction score
0
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.
 
Technology news on Phys.org
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
 
chasely said:
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.
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.
 
I recommend you get Dev C++ (bloodshed)
 
gcc is a command line compiler it's not an integrated development environment 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.
 
chasely said:
So I'm trying to cod C on my Mac,

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.
 
Coin said:
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.

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.
 

Similar threads

Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 15 ·
Replies
15
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
15K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 17 ·
Replies
17
Views
5K