Install gcc compiler on mac for visual code

broken image
broken image

Which will guide through the installation process. If you don’t have the Command Line Tools installed, open a Terminal and write: 1 xcode-select -install

broken image

At the time of this writing Apple’s Command Line Tools maps the gcc and g++ to clang and clang++. In the remaining of this article I will assume that you have installed the Command Line Tools for Xcode. In order to compile GCC from sources you will need a working C++ compiler. Testing your code with two different compilers is always a good idea.īuilding GCC 10 from sources could take some time, in my case it took a few hours on a MacBook Air with a 16GB of RAM. Another reason to have the latest stable version of GCC on your macOS is that it provides you with an alternative C and C++ compiler. you will need gfortran that comes with GCC. If you are interested in a modern Fortran compiler, e.g. If you are using Catalina (macOS 10.15) check this tutorial.Ĭlang, the default compiler for macOS, supports only C, C++, Objective-C and Objective-C++. The instructions from this tutorial were tested with latest version of Command Line Tools and Mojave (macOS 10.14). In this tutorial, I will show you how to compile from source and install the current stable version of GCC on your macOS computer.

broken image

Solarian Programmer My programming ramblings Home Archives Contact Privacy Compiling GCC 10 on macOS Mojave Posted on by Paul