0

I think I have several versions of gcc installed on my Mac OSX. Right now, when I type gcc --version. I got gcc (GCC) 4.6.0 20100703 (experimental) . But I want to use earlier version gcc. The thing is, i don't know how to find the path of older version gcc. Can anyone help me? Thanks.

1 Answer 1

2

By default, your gcc installations should be in /usr/bin/. So, for example, to use gcc 4.2, you'd use /usr/bin/gcc-4.2 to compile your files. You can do ls /usr/bin/gcc* to see which ones you have installed.

EDIT:
If gcc isn't installed in the default path (i.e., /usr/bin/), then you can execute locate gcc in the terminal to find where it is located.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.