A really embarassing, newbie question.

  • Thread starter chasely
  • Start date
In summary, the conversation discusses the process of coding in C on a Mac. The speaker has downloaded GCC from the GNU website but is unsure of how to access the compiler to write code. They are recommended to read the documentation and use a text editor to write the code, and then compile it using the gcc command. However, it is suggested to download the gcc build from Apple or use the Xcode IDE. The conversation concludes with the speaker thanking for the help and successfully getting the code to work through Xcode.
  • #1
chasely
2
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
  • #2
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
 
  • #3
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.
 
  • #4
I recommend you get Dev C++ (bloodshed)
 
  • #5
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.
 
  • #6
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.
 
  • #7
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.
 

FAQ: A really embarassing, newbie question.

What is considered a "newbie" question?

A newbie question is a question that is basic or elementary in nature and is typically asked by someone who is new to a certain topic or field of study. It may also refer to a question that has been asked and answered multiple times before.

Why do people feel embarrassed to ask newbie questions?

People may feel embarrassed to ask newbie questions because they may feel like they should already know the answer or they may fear being judged by others. They may also worry that their question is too simple or obvious.

Is it important to ask newbie questions as a scientist?

Yes, it is important to ask newbie questions as a scientist. Asking questions, no matter how basic, can lead to new insights and discoveries. It also shows a willingness to learn and improve one's understanding.

How can asking newbie questions benefit scientific research?

Asking newbie questions can benefit scientific research by encouraging critical thinking and challenging current beliefs and theories. It can also lead to new ideas and approaches to solving problems.

How can scientists create a safe space for asking newbie questions?

Scientists can create a safe space for asking newbie questions by promoting a culture of curiosity and open-mindedness. They can also emphasize the importance of asking questions and assure individuals that there is no such thing as a "stupid" question in science.

Back
Top