


This means GNU Compiler Collection was in fact installed successfully! So, you can compile and run a C++ program as follows: You will get the following:īut if you run gcc-11 (with 11 being the latest major release of GCC), you instead get the following:

After installation finishes, run gcc in the terminal. Next, from your terminal, run brew install gcc. We need Homebrew to allow us to install GCC. Navigate to brew.sh, copy their install command, and paste it into your macOS terminal and follow the instructions. To begin, we will need to install Homebrew. This post will show new macOS users with a Linux background how to switch to using GNU Compiler Collection instead of the Clang compiler, and benefit from the familiarity and additional features of GCC. As I joined Atomic Object, I began to use a MacBook Pro, and quickly realized I wish I had the GNU Compiler Collection (GCC) that I was familiar with from school, instead of Clang (the default macOS C/C++ compiler). That meant I spent much of my time writing C and C++ programs in a Linux environment before my professional career. Given that some of my computer science courses graded our programs on lab machines that ran a Linux distribution, I soon installed Ubuntu as a dual-boot on my laptop to gain more familiarity and experience with the operating system. Because I was most comfortable with Windows machines, upon entering university I was gifted a Windows laptop by my parents. If it starts to head into "we're going to design our window here, then make it work by writing this code." or "we'll display the output in a simple message box" then you probably won't be able to use a Mac for development - but it is still worth looking into the Windows versions of GCC.I never grew up with a Mac in the house. data processing, manipulation, advanced calculations, etc - then you won't have any problem. If it is more about the normal language without any Microsoft extensions - e.g.

So, it really depends what your course is about. There are third party libraries that let you do things like create and manipulate windows in sufficiently generic ways to build on both Mac and Windows, but I suspect they'll be outside of the realm of your course. What you obviously won't be able to do is develop programs that are intended to use Microsoft's specific Windows libraries, which roughly means anything that performs operations you wouldn't expect a text based operating system to perform. I'm no expert so I don't want to suggest anything. There aren't any IDEs as nice as XCode, but there are several that are usable. There are also versions of GCC for Windows such as MingW32. In any case, the deviations are small and adapting "proper" C++ code takes a very small amount of time. MSVC still didn't have complete C++ compliance last time I used it, but that was some time ago. GCC & the XCode toolset fully support the standard C and C++ languages.
