-
Install C++, Code Runner VS Code extension
-
Install & Config timeout:
brew install coreutils
sudo ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout
-
Then do this:
cd ~/Documents/
mkdir input_output
touch input.txt output.txt
-
Install gcc & Config it:
brew install gcc
cd /opt/homebrew/bin/
ln -s gcc-11 gcc
ln -s g++-11 g++
Run this to ensure your mac recognize the homebrew's gcc & g++ compiler:
where gcc g++
-
In VS Code navigate to:
Settings > Extensions > Run Code Configuration > Executor Map > settings.json
Copy everything from the settings.json in the repo and paste it there.
-
Create a layout (by opening a cpp file, ~/Documents/input_output/input.txt & ~/Documents/input_output/output.txt) and save that as a workspace. Save and Run by Ctrl+Alt+N & Stop by Ctrl+Alt+M
- Install lldb VS Code Extension
- Copy everything from the gdb_macm1 folder and paste it in your working directory’s .vscode folder.
Read this: