9

How can I find out if I have gcc installed on my machine?

I am trying to run CodeRunner, but it isn't responding. I know you have to have gcc installed in order for it to work properly. I do have Xcode 4.0.2 installed (from what I've read, if Xcode is installed then you already have gcc).

5 Answers5

8
  1. Type gcc at the Terminal prompt. If it says "command not found", you don't. Otherwise, you do.
  2. If that fails, then install from your OSX CD.
4

You could just try to see if a gcc executable is present. Try:

ls /usr/bin/gcc*
3

You can use "locate gcc" to find all filenames with gcc in them.

Xenoactive
  • 1,058
3

Try any terminal command, like:

$ gcc --help

If gcc isn't installed, you will often see a message with a "how to install it" note, complete with the package manager's command.

Gareth
  • 19,080
141.80
  • 89
0

On Terminal type

gcc -v

You will get something like below

Using built-in specs.
 ......
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

This will show you version of GCC installed on your machine. If gcc is not installed then this command will not work as above

silwar
  • 101