/clang-vscode

Compiling and Debugging C++ in Visual Studio Code for Mac OS X

Primary LanguageC++

Compiling and Debugging C++ in Visual Studio Code for Mac OS X

Setup

  1. Download XCode from the App Store. Open it and accept the Terms.
  2. Download Visual Studio Code
  3. Install C++ Extension
  4. Clone or Download this Github Repo

Debug

  1. Open cpp-vscode directory in Visual Studio Code
  2. Select a cpp file (eg helloworld/helloworld.cpp) and click Debug (little bug icon)
  3. To add a breakpoint, you can add a red dot by selecting the line you want to stop at (eg. line 7 in helloworld/helloworld.cpp)
  4. Run the Debugger again

Make New Files

  1. Create a directory with a name (eg whatever/)
  2. The file inside has to be the same name (whatever/whatever.cpp)

Resources