How to install C/C++ Compiler in Mac OS M1 Big Sur

Running a C/C++ program varies between different operating systems. However running it in visual studio code is pretty simple and does not requires any rocket science, just follow the steps mentioned in this article and you’ll be good to go. So let’s learn How To Install C/C++ Compiler on Mac OS.

 

Video Tutorial: How to Install C/C++ Compiler in Mac OS

 

If you’re still finding it hard installing C/C++ compiler in your Mac machine then you can refer to the below video for a complete guide.

 

👉 Click Here To Enroll in Complete C++ Programming Course: Go From Beginner to Beyond with an additional discount.

👉 Click Here To Enroll in Complete C Programming Course: Go From Beginner to Master with an additional discount.

 Install MinGW Compiler

 

1) Firstly we will download the C++ compiler for our Mac machine and for that we’re going to download the MinGW compiler. So press Cmd+space,  type terminal in the search bar and press enter.

 

 

 

2) In the terminal window copy the code provided below and press enter, this will install Homebrew in your Mac system. If asked for password, enter it as well. Also this process may take some time so have patience.

 

Intel Mac:/bin/bash -c "$(curl -fsSL http://bit.ly/homebrew_techdecode)"

M1 Mac :  arch -x86_64 /bin/bash -c "$(curl -fsSL http://bit.ly/homebrew_techdecode)"

 

 

 

3) Now we’ll install MinGw compiler on your Mac OS, simply paste the below-provided code and press enter, this process may also take some time. There will be a progress bar showing the percentage of download that has been installed.

 

Intel Mac: brew install MinGW-w64

M1 Mac: arch -x86_64 brew install mingw-w64

 

 

 

4) After successful installation of MinGW compiler your terminal window will look somewhat similar to the below image.

 

 

Congratulations you’ve successfully installed MinGW compiler in your Mac machine.

👉 Click Here To Enroll in Complete C++ Programming Course: Go From Beginner to Beyond with an additional discount.

👉 Click Here To Enroll in Complete C Programming Course: Go From Beginner to Master with an additional discount.

Also Read: How To Run C++ in Visual Studio Code on Mac OS

Ethix

I'm a coding geek interested in cyberspace who loves to write and read

2 thoughts on “How to install C/C++ Compiler in Mac OS M1 Big Sur

  • November 11, 2021 at 5:09 AM
    Permalink

    Hello,

    I recently bought a Macbook air with the M1 chip. I follow coding lessons in school but we use windows in school i was wondering if it is possible to use a mac and do the things as a windows.

    i follow coding and webdesign both in visual studio but they are in like diffrent programs one is blue the other pink (on windows)
    i can asume this sounds really dumb, but im new to programming and i just want to know if my mac can do the same as windows.

    in you video’s you can see that the runner is in visual studio itself, i wonder if it’s possible to have a seprate window pop up like on windows then you can also work with for example: gotoxy(..,..).

    i hope this makes sence and i hope you can help me.

    have a nice day,
    – Mattijs

    Reply
  • April 19, 2023 at 11:01 AM
    Permalink

    I am unable to run the first command itself.It shows an error as : arch: posix_spawnp: /bin/bash: Bad CPU type in executable Please help me with this

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *