How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Martin Your Own Question

Martin, Physicist
Category: Homework
Satisfied Customers: 781
Experience:  20+ years of research, engineering and teaching
Type Your Homework Question Here...
Martin is online now
A new question is answered every 9 seconds

Using a MacBook, OSX 10.8.x, and need to start using the C

This answer was rated:

Using a MacBook, OSX 10.8.x, and need to start using the C Compiler, which is gcc. I've downloaded XCode, and installed the gcc compiler. I've located a symbolic link to the gcc in /Applications/
However, when I CD to that location, I receive a "not a file" notification when the gcc command is issued.
Two things are needed:
1. What needs to be done so that I can compile?
2. How can I "shorten" the long names, so that they'll fit into a shell? In addition to compiling programs, I'll need to run them.
Pointing me to a book is also a satisfactory answer.

3. I'm experienced with BAT files in Windows, and have started with OSX shell commands, and have some that are working, but I don't know how to transfer those concepts to OSX.

You need to spend $3 to view this post. Add Funds to your account and buy credits.
Martin and 4 other Homework Specialists are ready to help you
Customer: replied 3 years ago.

Hi, Martin,


No way for you to know, but this wasn't homework. I've used C, over the years, but never on a Mac.

When the "which" command is entered, it shows NOTHING! It just goes to the next line.


As you can tell, I'm still finding my way around the Mac; I've written lots of code in many different languages, and lots of work in MS Office and now also learning LibreOffice.


I have installed the gcc from XCode. Need I do it again?

And what is the output from

$ env | grep PATH
Customer: replied 3 years ago.

PATH=/Users/LeonStevens2/Library/Application Support/GoodSync:/Users/lstevens0411/Library/Application Support/GoodSync:/Users/lstevens0411/Library/Application Support/GoodSync:/Library/Frameworks/Python.framework/Versions/3.3/bin:/Users/lstevens0411/Library/Application Support/GoodSync:/Users/lstevens0411/Library/Application Support/GoodSync:/Library/Frameworks/Python.framework/Versions/3.2/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/

This looks fine. I would expect gcc to be in /usr/bin. Can you verify that it is not there?

Another thing that concerns me is that if gcc does not exist in your PATH directories, then you should get the following result

$ gcc
bash: gcc: command not found

What exactly do you get when you execute a bare "gcc" at the command line?
Customer: replied 3 years ago.

Just did an ls /usr/bin and there is no gcc there.

When I execute a gcc command, I do receive bash: gcc: command not found

OK, we need to find it. If it's not there, we'll need to install it. Try:

$ find / -name gcc 2>/dev/null

This will run for quite a while, but after thirty seconds or so you'll have your results and can kill it with "<cntrl> c".
Customer: replied 3 years ago.



It ran, and completed in about 20 seconds.

When I posted it here, the reply was denied.


I have the answer, it is about a terminal screen full.


What should I do?

Customer: replied 3 years ago.

Martin, I'll have to leave in about 20 minutes, so when I don't respond, it's because I left.



You could paste it into a word doc and upload it here. Here are instructions.
Customer: replied 3 years ago.

This is a note.

Got it, thanks.

Based on this, I think what might be needed is the Xcode command line tools.

1) Start Xcode
2) Select Preferences from the Xcode menu
3) Click on the Downloads tab
4) Install "Command Line Tools".

Restart, and see if that helps.

Related Homework Questions