<resource title="Visual Studio Code" url="https://code.visualstudio.com/" starred>Lightweight, fast IDE, but requires some configuration. See <a href="http://www.csc.kth.se/~jsannemo/slask/main.pdf">PAPC 2.1</a> for setup instructions.</resource>
<resource title="Geany" url="https://www.geany.org/" starred>Lightweight, frequently used at IOI.</resource>
<resource title="Visual Studio" url="https://visualstudio.microsoft.com/vs/">Heavier cousin of VS Code. VS Code is better for competitive programming.</resource>
<resource title="Codeblocks" url="http://www.codeblocks.org/">Bad on Mac.</resource>
<resource title="CLion" url="https://www.jetbrains.com/clion/">Requires a license, but <a href="https://www.jetbrains.com/community/education/#students">free for students</a>.</resource>
<resource title="Sublime Text 3" url="https://www.sublimetext.com/" starred>Fast, lightweight. Keeps asking you to purchase a license ...</resource>
<resource title="Atom" url="https://atom.io/">From the makers of Github.</resource>
<resource title="Vim" url="https://www.vim.org/">Classic text editor, usually preinstalled on Linux.</resource>
</resources>
Vim is probably the easiest way to print syntax-highlighted code on Mac, see the response to [this post](https://stackoverflow.com/questions/1656914/printing-code-with-syntax-highlighting).
First, download and run the [MinGW installer](https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/). Once it's installed, open the MinGW Installation Manager, click on Basic Setup on the left, and select `mingw32-gcc-g++-bin` for installation.
[Adding MinGW to PATH](https://www.rose-hulman.edu/class/csse/resources/MinGW/installation.htm)
Another good option is Windows Subsystem for Linux (WSL) which is what I (Anthony) personally use, although it may be more difficult to properly set up.
[Clang](https://en.wikipedia.org/wiki/Clang) is the default compiler for Mac OS X, but you should use [GCC](https://en.wikipedia.org/wiki/GNU_Compiler_Collection)'s g++ since that's what [USACO](http://www.usaco.org/index.php?page=instructions) uses to compile your code.
<resource source="Jim Hoskins" title="Intro to OS X Command Line" url="https://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line" starred></resource>
According to [this](https://stackoverflow.com/questions/30998890/installing-opencv-with-brew-never-finishes) if `brew` doesn't seem to finish for a long time then
It's not hard to [compile & run a C++ program](https://www.tutorialspoint.com/How-to-compile-and-run-the-Cplusplus-program). First, open up Powershell on Windows, Terminal on Mac, or your distro's terminal in Linux. We can compile `name.cpp` into an executable named `name` with the following command:
Use [compiler flags](https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/) to change the way GCC compiles your code. Usually, we use the following in place of `g++ name.cpp -o name`:
`g++ -std=c++17 -O2 name.cpp -o name -Wall -Wextra -Wshadow`
Explanation:
- `-O2` tells `g++` to compile your code to run more quickly (see [here](https://www.rapidtables.com/code/linux/gcc/gcc-o.html))
Now you can easily compile and run `name.cpp` from the command line with `co name && ./name` or `run name`. Note that all occurrences of `$1` in the function are replaced with `name`.