will4614 / CPP_VSCode_WinMacLinux

1 stars 1 forks source link

C++ in VS Code on Mac, Windows, Linux

Make sure your set the platform correctly on the bottom right of the VS Code window.

Code Formatting

Apply the coding standards via:

Commands:

F5: Start Debugging (works)

Control-F5: Start without Debugging (works WINDOWS, not working MAC, output shows up in DEBUG CONSOLE)

Not sure if Start without Debugging should work

Control-Shift-B: Build (works)

Terminal | Run task | clean (works, calls make clean)

Mac:

Use built in gcc/llvm and debugger:

Linux:

Use built in gcc and debugger

Windows:

current test: using Visual Studio Build Tools (cl, nmake)

Git: Git For Windows Not the Portable Install

Which is the easiest compiler tool chain for students to install/use on Windows?

Codespaces

Notes

Git

Key bindings

You can use key bindings to provide the not working Ctrl-F5 Start without Debugging feature:

keybindings.json:

  {
    "key": "Ctrl+F5",
    "command": "workbench.action.tasks.runTask",
    "args": "runMe",
    "when": "!inDebugMode"
  }

Create a runMe task in tasks.json which calls the correct Makefile to build and run the executable.

Note that keybindings are a per user setting, not a per project setting.