If you have the most recent Apple Command Line Tools (macOS 10.nn) for Xcode installed for your operating system version — which you get from developer.apple.com/download/more, then you need a package manager (e.g. homebrew) to install, and compile GCC and all of its dependencies. That compilation process will take at least an hour. After you initially install homebrew (brew):
I am looking for a simple gcc compiler that will run under my emulated Mac OS 9.2.2 environment. Where's the best place to look?
# In the bash shell (e.g. .bash_profile), gag Google Analytics in Homebrew.
export HOMEBREW_NO_ANALYTICS=1
brew update
brew upgrade
brew info gcc
brew install gcc
brew cleanup (this removes previous application/dependency revisions saving considerable space)
The gcc application will be installed by default in /usr/local/bin.
Personally, I use Apple's clang/clang++ compilation tools rather than deal with GNU gcc.
About the App
- App name: gcc
- App description: GNU compiler collection
- App website: https://gcc.gnu.org
Install the App
- Press
Command+Space
and type Terminal and press enter/return key. - Run in Terminal app:
ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)' < /dev/null 2> /dev/null
and press enter/return key.
If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish. - Run:
brew install gcc
Done! You can now use
gcc
.